Abstract
Liquid chromatography tandem mass spectrometry (LC-MS/MS) is a critical analytical technique for molecular identification across metabolomics, environmental chemistry, and chemical forensics. A variety of computational methods have emerged for structural annotation of spectral features of interest, but many of these features cannot be confidently annotated with reference structures or spectra. Here, we introduce FOAM (Formula-constrained Optimization for Annotating Metabolites), a computational workflow that poses structure elucidation from LC-MS/MS as an iterative optimization problem. FOAM couples a formula-constrained graph genetic algorithm with spectral simulation to explore candidate annotations given an experimental spectrum. We demonstrate FOAM's performance on the NIST'20 and MassSpecGym datasets as both a standalone elucidation pipeline and as a complement to existing inverse models. This work establishes iterative optimization as an effective and extensible paradigm for structural elucidation.
Introduction
Identifying unknown molecules from mass spectrometry data remains a significant bottleneck in chemical and biological research. Liquid chromatography tandem mass spectrometry (LC-MS/MS) generates fragmentation patterns (mass spectra) that serve as molecular "fingerprints." While traditional methods rely on matching these fingerprints against libraries of known reference spectra, this approach is ineffective for novel or uncatalogued molecules.
Recent de novo machine learning models attempt to generate molecular structures directly from spectra, but they often struggle to navigate the vast chemical space. This paper proposes a shift in perspective: treating structural elucidation as an iterative optimization problem, similar to drug design, where molecular structures are evolved to match experimental data.
Methods: The FOAM Workflow
The authors introduce FOAM (Formula-constrained Optimization for Annotating Metabolites), a closed-loop evolutionary approach. The workflow consists of several key stages:
- Initialization: Using a target spectrum and its chemical formula, FOAM selects "seed" structures from databases like PubChem or outputs from other AI models.
- Simulation & Scoring: The ICEBERG deep learning simulator predicts mass spectra for candidate structures. These are then scored based on their similarity to the experimental target.
- Multi-Objective Optimization: Candidates are ranked based on spectral similarity and structural simplicity to ensure chemical feasibility.
- Genetic Algorithm: Top candidates undergo formula-constrained crossover and mutation. These operations swap fragments or make small structural changes while strictly maintaining the original chemical formula.
- Iteration: This cycle of simulation, scoring, and evolution repeats until a termination criterion is reached.
Results and Discussion
FOAM was evaluated on the high-quality NIST'20 reference library and the challenging MassSpecGym benchmark.
Performance Metrics
On the NIST'20 dataset, FOAM demonstrated a high encounter rate, successfully generating the true molecule during its search 68.1% of the time. Within just three generations, FOAM placed the true molecule in the Top 10 list for 31% of cases and as the top prediction for 11%. Even when the exact match was not found, the top candidates showed high structural similarity to the ground truth (average 0.63 Tanimoto similarity).
Synergy and Prospective Success
A key strength of FOAM is its ability to refine outputs from other generative models. On MassSpecGym, refining DiffMS outputs with FOAM more than doubled the Top-10 exact match rate from 4.25% to 10.28%. Additionally, the authors developed a logistic regression model to predict the likelihood of the true molecule being in the final Top 10, providing a valuable confidence score for experimentalists.
Limitations and Future Directions
FOAM's performance is inherently tied to the accuracy of its "oracle," the ICEBERG spectral simulator. Inaccurate simulations, often due to missing metadata like collision energies, can lead the optimization toward incorrect structures.
Future work aims to incorporate additional orthogonal data into the scoring function, such as retention-time predictions or biosynthetic feasibility. The integration of Bayesian optimization could also improve the handling of uncertainty during the search process, further solidifying iterative optimization as a robust paradigm for structural elucidation.
Summary updated