MIST-CF: Chemical Formula Inference from Tandem Mass Spectra

Samuel Goldman, Jiayi Xin, Joules Provenzano, Connor W. Coley · DOI · OpenReview

Abstract

Chemical formula annotation for tandem mass spectrometry (MS/MS) data is the first step toward structurally elucidating unknown metabolites. While great strides have been made toward solving this problem, the current state-of-the-art method depends on time-intensive, proprietary, and expert-parameterized fragmentation tree construction and scoring. In this work we extend our previous spectrum Transformer methodology into an energy based modeling framework, MIST-CF, for learning to rank chemical formula and adduct assignments given an unannotated MS/MS spectrum. Importantly, MIST-CF learns in a data dependent fashion using a Formula Transformer neural network architecture and circumvents the need for fragmentation tree construction. We train and evaluate our model on a large open-access database, showing an absolute improvement of 10% top 1 accuracy over other neural network architectures. We further validate our approach on the CASMI2022 challenge dataset, achieving nearly equivalent performance to the winning entry within the positive mode category without any manual curation or post-processing of our results. These results demonstrate an exciting strategy to more powerfully leverage MS2 fragment peaks for predicting MS1 precursor chemical formula with data driven learning.

Introduction

In fields ranging from drug discovery to environmental science, researchers frequently encounter the "dark metabolome"—molecules that are detected via mass spectrometry but remain unidentified in existing databases. Identifying these unknowns begins with determining their chemical formula. The standard approach involves Tandem Mass Spectrometry (MS/MS), which provides the mass of the intact precursor molecule (MS1) and its fragmentation pattern (MS2).

Historically, the gold standard for formula identification, such as the SIRIUS framework, has relied on the construction of "fragmentation trees." These trees attempt to model the hierarchical breakdown of a molecule based on expert-defined rules. However, this process is computationally expensive, often proprietary, and can struggle with larger, more complex molecules. MIST-CF (Metabolite Inference with Spectrum Transformers for Chemical Formulae) addresses these limitations by replacing rule-based trees with a data-driven Transformer architecture.

Methodology

MIST-CF frames formula identification as a ranking problem using an Energy-Based Model (EBM). The workflow consists of several key stages:

  1. Candidate Generation and Filtering: The system generates all mathematically possible formulas matching the observed MS1 mass. To manage the search space, a lightweight "FastFilter" neural network narrows these candidates down to the top 256 biologically plausible formulas.
  2. Subformula Annotation: For each candidate, MS2 fragment peaks are labeled with potential sub-formulas (molecular fragments).
  3. Formula Transformer: These sub-formulas are processed by a Transformer architecture. Unlike fragmentation trees, the Transformer learns the complex relationships and dependencies between fragments directly from the data, assigning a score (energy) to each candidate formula based on how well it matches the observed spectrum.
Overview of the MIST-CF workflow compared to traditional fragmentation tree methods.

The model was trained on a combination of the public NPLIB1 natural products dataset (GNPS) and the commercial NIST20 library, totaling approximately 45,800 spectra. Validation was performed on the NPLIB1 test set and the independent CASMI2022 "blind" challenge dataset.

Results and Discussion

MIST-CF demonstrates significant performance gains over both traditional methods and previous neural network approaches:

  • Improved Accuracy: MIST-CF achieved a 10% absolute improvement in Top-1 accuracy compared to other neural network baselines. On the NPLIB1 test set, it correctly identified formulas 71% of the time, significantly outperforming the out-of-the-box version of SIRIUS (48%).
  • Competitive Performance: In the CASMI2022 challenge, MIST-CF reached a joint formula/adduct accuracy of 86.8%. This matched the performance of the winning entry, with the critical advantage that MIST-CF operated fully automatically, whereas the competition winner required manual curation.
  • Efficiency and Scalability: The model is approximately 3x faster than SIRIUS on standard hardware. Furthermore, it maintains consistent performance for larger molecules (over 800 Da), where traditional tree-based methods often experience timeouts or reduced accuracy.

The success of MIST-CF suggests that neural networks can effectively learn the "logic" of molecular fragmentation from large datasets, capturing nuances that human-defined rules might miss.

Conclusion

MIST-CF represents a shift toward data-driven discovery in metabolomics. By bypassing the need for expert-tuned fragmentation trees, it offers a more efficient and accurate path to identifying unknown molecules. Future developments will focus on extending the model to "negative mode" ions and integrating isotopic patterns to further refine formula inference. Currently, the model still utilizes external algorithms for initial mass decomposition, and moving toward a fully end-to-end, independent pipeline remains a primary goal for future research.

Summary updated

BibTeX
@article{goldman2024mist,
  author = {Samuel Goldman and Jiayi Xin and Joules Provenzano and Connor W. Coley},
  title = {{MIST-CF: Chemical Formula Inference from Tandem Mass Spectra}},
  journal = {Journal of Chemical Information and Modeling},
  year = {2024},
  doi = {10.1021/acs.jcim.3c01082},
}
Figure