  Context. A variety of laboratory ice spectra simulating different chemical
environments, ice morphology as well as thermal and energetic processing are
demanded to provide an accurate interpretation of the infrared spectra of
protostars. To answer which combination of laboratory data best fit the
observations, an automated statistically-based computational approach becomes
necessary. Aims. To introduce a new approach, based on evolutionary algorithms,
to search for molecules in ice mantles via spectral decomposition of infrared
observational data with laboratory ice spectra. Methods. A publicly available
and open-source fitting tool, called ENIIGMA (dEcompositioN of Infrared Ice
features using Genetic Modelling Algorithms), is introduced. The tool has
dedicated Python functions to carry out continuum determination of the
protostellar spectra, silicate extraction, spectral decomposition and
statistical analysis to calculate confidence intervals and quantify degeneracy.
As an assessment of the code, several tests were conducted with known ice
samples and constructed mixtures. A complete analysis of the Elias 29 spectrum
was performed as well. Results. The ENIIGMA fitting tool can identify the
correct ice samples and their fractions in all checks with known samples tested
in this paper. Concerning the Elias 29 spectrum, the broad spectral range
between 2.5-20 $\mu$m was successfully decomposed after continuum determination
and silicate extraction. This analysis allowed the identification of different
molecules in the ice mantle, including a tentative detection of CH$_3$CH$_2$OH.
Conclusions. The ENIIGMA is a toolbox for spectroscopy analysis of infrared
spectra that is well-timed with the launch of the James Webb Space Telescope.
Additionally, it allows for exploring the different chemical environments and
irradiation fields in order to correctly interpret astronomical observations.
