MassGenie: a transformer-based deep learning method for identifying small molecules from their mass spectra
Aditya Divyakant Shrivastava, Neil SwainstoniD, Soumitra SamantaiD, Ivayla RobertsiD, Marina Wright MuelasiD, Douglas Bruce KelliD
Abstract
The inverse problem of mass spectrometric molecular identification ( given a mass spectrum, calculate the molecule whence it came) is largely unsolved, and is especially acute in metabolomics where many small molecules remain unidentified. This is largely because the number of experimentally available electrospray mass spectra of small molecules is quite limited. However, the forward problem ( calculate a small molecules likely fragmentation and hence at least some of its mass spectrum from its structure alone) is much more tractable, because the strengths of different chemical bonds are roughly known. This kind of molecular identification problem may be cast as a language translation problem in which the source language is a list of high-resolution mass spectral peaks and the translation a representation (for instance in SMILES) of the molecule. It is thus suitable for attack using the deep neural networks known as transformers. We here present MassGenie, a method that uses a transformer-based deep neural network, trained on ~6 million chemical structures with augmented SMILES encoding and their paired molecular fragments as generated in silico, explicitly including the protonated molecular ion. This architecture (containing some 400 million elements) is used to predict the structure of a molecule from the various fragments that may be expected to be observed when some of its bonds are broken. Despite being given essentially no detailed nor explicit rules about molecular fragmentation methods, isotope patterns, rearrangements, neutral losses, and the like, MassGenie learns the effective properties of the mass spectral fragment and valency space, and can generate candidate molecular structures that are very close or identical to those of the true molecules. We also use VAE-Sim, a previously published variational autoencoder, to generate candidate molecules that are similar to the top hit. In addition to using the top hits directly, we can produce a rank order of these by round-tripping candidate molecules and comparing them with the true molecules, where known. As a proof of principle, we confine ourselves to positive electrospray mass spectra from molecules with a molecular mass of 500Da or lower. The transformer method, applied here for the first time to mass spectral interpretation, works extremely effectively both for mass spectra generated in silico and on experimentally obtained mass spectra from pure compounds. The ability to create and to learn millions of fragmentation patterns in silico, and therefrom generate candidate structures (that do not have to be in existing libraries) directly, thus opens up entirely the field of de novo small molecule structure prediction from experimental mass spectra.
02 /Specification & Classification
Click any tag to browse matching papers- Citations
- 87
- FWCI
- 4.92
- Field percentile
- top 2%
- Assay
- Research Focus
- Approach
Reproducibility ledger
Nobody has reported trying to reproduce this paper yet. Did you replicate an experiment or run the code? Your report saves the next lab a week.
Sign in to file a reproducibility report.
Related papers
- MolDiscovery: Learning Mass Spectrometry Fragmentation of Small Molecules
Liu Cao, Mustafa Güler, … Hosein Mohimani·Nature CommunicationsPeer-reviewed·Jun 17, 2021
- Mass2SMILES: deep learning based fast prediction of structures and functional groups directly from high-resolution MS/MS spectra.
David Elser, Florian Huber, Emmanuel Gaquerel·bioRxiv·Jul 6, 2023
- Annotating metabolite mass spectra with domain-inspired chemical formula transformers
Samuel Goldman, Jeremy Wohlwend, … Connor W. Coley·Nature Machine IntelligencePeer-reviewed·Aug 17, 2023
- MSNovelist: De novo structure generation from mass spectra
Michael A. Stravs, Kai Dührkop, … Nicola Zamboni·Nature MethodsPeer-reviewed·May 30, 2022
- FIDDLE: a deep learning method for chemical formulas prediction from tandem mass spectra
Yuhui Hong, Sujun Li, … Haixu Tang·Nature CommunicationsPeer-reviewed·Dec 12, 2025
- DEEPNET-LLM: Highly accurate structure prediction of unknown metabolites from mass spectra via their molecular neighborhoods
Alexey V Melnik, Andrew Mitchell Pusey Roberts, … Alexander A Aksenov·bioRxiv·Nov 3, 2026