Source-linked AI summary

Rapid Prediction of Electron-Ionization Mass Spectrometry using Neural Networks

Jennifer N. Wei, David Belanger, Ryan P. Adams, D. Sculley

arXiv:1811.08545v2physics.chem-phstat.ML

TL;DR

Library matching cannot identify molecules absent from existing spectral libraries, motivating synthetic spectra for improved coverage. The paper presents NEIMS, a lightweight neural network that directly predicts EI-MS spectra for small molecules, with an architecture designed for accurate prediction. NEIMS achieves high library-matching performance while enabling rapid spectral generation compared with prior approaches.

  • Problem

    Library matching cannot identify molecules absent from existing libraries, while augmenting coverage with predicted spectra has been impractical because existing prediction methods are computationally expensive.

  • Method

    NEIMS is a lightweight neural network that directly predicts the electron-ionization mass spectrum of a small molecule, outputting intensities for integral m/z bins.

  • Results

    NEIMS achieves high library matching performance on an augmented library, using an optimal MLP with seven 2000-node layers, residual connections, ReLU activation, and 0.25 dropout.

  • Takeaways & Limitations

    NEIMS rapidly generates spectral predictions for thousands of candidates in seconds, supporting expansion of mass-spectral library coverage.

Abstract

from arXiv · show

When confronted with a substance of unknown identity, researchers often perform mass spectrometry on the sample and compare the observed spectrum to a library of previously-collected spectra to identify the molecule. While popular, this approach will fail to identify molecules that are not in the existing library. In response, we propose to improve the library's coverage by augmenting it with synthetic spectra that are predicted using machine learning. We contribute a lightweight neural network model that quickly predicts mass spectra for small molecules. Achieving high accuracy predictions requires a novel neural network architecture that is designed to capture typical fragmentation patterns from electron ionization. We analyze the effects of our modeling innovations on library matching performance and compare our models to prior machine learning-based work on spectrum prediction.

Introduction

Mass spectrometry identifies unknown samples by comparing measured spectra with library spectra, but library coverage limits this approach. NEIMS addresses the gap by rapidly predicting synthetic electron-ionization spectra for small molecules to augment libraries.

  • Library matching: Mass spectrometry identifies unknown molecular samples by comparing a query spectrum with library spectra using a similarity function.With reasonable measurement noise, the highest-similarity library spectrum corresponds to the correct identification.
  • Coverage problem: Library matching cannot correctly identify molecules absent from the reference library.Existing libraries contain hundreds of thousands of spectra, and newly synthesized compounds are typically not incorporated.
  • Coverage problem: Adding spectra experimentally is time consuming and expensive; NIST updates its library every 3 years with roughly 20,000 new spectra.Mass spectra of new molecules are added only when the molecule is of common interest.
  • Synthetic spectra: Existing spectrum-prediction methods estimate bond-breaking probabilities and fragment frequencies using quantum mechanics or machine learning, but can take up to 10 min per large molecule.Their prediction time scales with molecular size, limiting rapid generation of spectra collections.
  • NEIMS: NEIMS is a neural network that directly predicts electron-ionization mass spectra for small molecules instead of bond-breaking probabilities.Its lightweight design generates predictions for thousands of candidates in seconds and can be retrained for other ionization methods.
  • Evaluation: On small molecules from the NIST 2017 Mass Spectral Library, NEIMS has predictive capability similar to prior machine-learning models while requiring much less prediction time.The paper also evaluates the similarity of NEIMS-predicted spectra.

Background

Prior work includes methods that infer molecular identities from spectra and methods that predict spectra from molecules. Spectrum prediction has used first-principles simulations and machine learning, but existing approaches are too slow for large-scale library augmentation.

  • Identity prediction: Earlier mass-spectrometry models used neural networks, fingerprints, SMILES representations, ranked structural lists, or expert rules to infer molecule identities from spectra.DENDRAL and Meta DENDRAL used chemistry-based rules, with Meta DENDRAL learning rules originally supplied by experts.
  • Spectrum prediction: This work focuses on predicting spectra from molecules rather than predicting molecule identities from spectra.The stated advantage is the ability to augment existing libraries with synthetic spectra.
  • First-principles methods: First-principles EI-MS prediction methods include quasi-equilibrium theory, bond-order energy calculations, and Born-Oppenheimer molecular dynamics.Molecular-dynamics trajectories are analyzed for ionic fragments, whose aggregated distribution is renormalized into a calculated spectrum.
  • Computational limitations: First-principles methods require at least 1000 seconds per molecule and may take days or weeks for molecules of 50 atoms.They therefore lack the speed needed to generate spectra for thousands of molecules rapidly.
  • Machine-learning methods: CFM-EI predicts bond-breaking probabilities and likely charged fragments, then uses stochastic simulation to estimate fragment frequencies for the spectrum.The paper directly compares this machine-learning method with NEIMS.

Methods

The paper develops a lightweight MLP-based method for predicting EI mass spectra and augmenting reference libraries, with architecture changes designed to capture fragmentation patterns and improve high-mass predictions.

  • Library matching: The method predicts EI-MS spectra for molecules and uses them to augment libraries containing experimentally measured spectra.The intended downstream task is library matching against both NIST spectra and model-predicted spectra.
  • Spectral prediction: The model treats spectrum prediction as multidimensional regression, outputting intensities for every integral m/z bin.The integral-bin discretization matches the granularity available in the NIST training datasets.
  • Molecular representation: Molecules are represented with additive ECFPs that count hashed local molecular substructures before passing into an MLP.The fingerprints use local neighborhoods around atoms and retain subgroup occurrence counts rather than only binary presence.
  • Architecture: The architecture combines forward and reverse prediction modes with coordinate-wise sigmoid gating to incorporate physical ionization phenomena while retaining MLP simplicity.Forward prediction proceeds from low to high m/z, whereas reverse prediction proceeds from the molecular mass toward lower m/z.
  • Evaluation: The model improves prediction in the high-mass region and yields improvements in library matching, while the reverse mode more accurately predicts intensities.The bidirectional prediction also shows fewer stray peaks, particularly at larger m/z values.
  • Architecture: Reverse prediction addresses forward-model weaknesses for large fragments and neutral-loss peaks, which are not well captured by local ECFP features.The paper links these errors to poor representation of large-fragment composition and weak transfer of small-group cleavage information across molecular masses.

Results and Discussion

The experiments show that bidirectional prediction improves library matching and spectral prediction, while NEIMS approaches but does not match the NIST library at low recall levels. NEIMS slightly outperforms CFM-EI while generating spectra far faster.

  • 240,942 NIST spectra were used for training, with replicate molecules excluded from the training set.
  • The tuned MLP uses seven 2000-node layers with residual connections, ReLU activation, and 0.25 dropout.
  • 86% recall@1 and 98.3% recall are reported for the NIST main library, establishing that perfect recall is unattainable even without predicted spectra.The NIST library itself performs better than NEIMS at recall levels 1 and 5, whereas NEIMS has decent performance at recall levels 10 and above.
  • 30% higher recall@10 accuracy is achieved by bidirectional prediction for both linear regression and MLP models, compared with forward prediction.Reverse prediction improves the linear regression model by 20%, and the authors associate bidirectionality with better fragmentation-event capture.
  • 91.7% recall@10 is achieved by NEIMS after applying a 5 Da mass filter, reducing each query library to a median of 6,696 spectra.The default NEIMS setting uses bidirectional MLP prediction with 5-Dalton mass filtering.
  • NEIMS performs slightly better than CFM-EI and could generate spectra for 1 million molecules in 90 minutes on a CPU.The authors also note potential for considerable speedup using a GPU.

Conclusion

NEIMS achieves high library-matching performance while rapidly generating spectra for many molecular candidates. The conclusion attributes matching gains to bidirectional prediction and identifies limitations in isotope modeling and molecular representation.

  • NEIMS achieves high library-matching performance on an augmented spectral library.
  • NEIMS is slightly better than existing machine learning models for predicting EI-MS spectra and offers a significant boost in prediction speed.
  • Bidirectional prediction improves library matching, with reverse mode helping predict intensities for larger fragments formed after small neutral groups are lost.
  • Library-matching improvement corresponds to improved similarity between predicted and ground-truth spectra.
  • Current limitations include absent isotope-peak modeling and ECFP representations limited by overlapping molecular features.
  • Mass filtering improves NEIMS performance by 6%, particularly when molecular mass is known accurately enough to filter candidate spectra.
  • Graph-convolutional, especially bond-centered, representations could improve predictive accuracy at slightly higher computational cost, while transfer learning could support machine-specific spectra.
  • The lightweight framework rapidly generates spectra for large numbers of molecular candidates, which can expand molecular coverage in mass spectrometry software.

Supplementary information

The supplementary information includes peripheral analyses and details about the relationship between molecular similarity, predicted-spectrum similarity, and model training.

  • The implementation code is available at github.com/brain-research/deep-molecular-massspec.
  • The supplementary information discusses the relationship between Tanimoto similarity and predicted-spectrum similarity.
  • It also contains details about training and spectrum-related procedures.
Loading 1811.08545v2…