[Paper Review] Efficiently predicting high resolution mass spectra with graph neural networks
GrAFF-MS predicts high-resolution mass spectra by mapping molecular graphs to a fixed vocabulary of formulas, enabling efficient, accurate spectrum prediction that outperforms state-of-the-art methods both in accuracy and speed.
Identifying a small molecule from its mass spectrum is the primary open problem in computational metabolomics. This is typically cast as information retrieval: an unknown spectrum is matched against spectra predicted computationally from a large database of chemical structures. However, current approaches to spectrum prediction model the output space in ways that force a tradeoff between capturing high resolution mass information and tractable learning. We resolve this tradeoff by casting spectrum prediction as a mapping from an input molecular graph to a probability distribution over molecular formulas. We discover that a large corpus of mass spectra can be closely approximated using a fixed vocabulary constituting only 2% of all observed formulas. This enables efficient spectrum prediction using an architecture similar to graph classification - GrAFF-MS - achieving significantly lower prediction error and orders-of-magnitude faster runtime than state-of-the-art methods.
Motivation & Objective
- Motivate the challenge of identifying small molecules from MS/MS spectra and the need for high-resolution spectrum prediction.
- Propose a spectrum representation as distributions over precursor subformulas to preserve m/z resolution.
- Demonstrate that a fixed vocabulary of formulas captures most spectral signal and enables scalable learning.
- Develop GrAFF-MS, a graph neural network that predicts spectra efficiently and accurately.
- Evaluate GrAFF-MS against state-of-the-art baselines on large MS/MS datasets.
Proposed method
- Model spectra as probability distributions over molecular subformulas of the precursor P.
- Introduce a fixed vocabulary hatF(P) consisting of frequent product ions and neutral losses to approximate F(P).
- Train with peak-marginal cross entropy that marginalizes over compatible formulas per peak.
- Use a graph neural network (GrAFF-MS) with a GINEConv-based message passing and attention pooling to decode per-formula heights.
- Incorporate domain-specific corrections for adducts, isotopic states, and double-counting between product ions and neutral losses.
- Predict logits for formulas in the fixed vocabulary and apply softmax with isotope/adduct adjustments to yield spectrum heights.
Experimental results
Research questions
- RQ1Can a fixed vocabulary of frequent product ions and neutral losses capture the majority of spectral signal for small molecules?
- RQ2Does predicting spectra as distributions over formulas enable high-resolution (m/z) predictions without enumerating substructures?
- RQ3How does GrAFF-MS compare to bond-breaking and mass-binning approaches in accuracy and runtime?
- RQ4Is the fixed-vocabulary approach generalizable to independent datasets beyond training data?
- RQ5What are the practical scalability and speed advantages of GrAFF-MS on large molecular databases?
Key findings
- A fixed vocabulary of about 10,000 formulas explains ~98% of ion counts in the NIST-20 training split.
- GrAFF-MS achieves higher mean cosine similarity than baselines on both datasets: NIST-20 test mean C = 0.70 and CASMI-16 mean C = 0.79.
- GrAFF-MS yields higher usefulness (C>0.7) than baselines: NIST-20 0.62 vs 0.35–0.50 for baselines; CASMI-16 0.76 vs 0.54–0.70 for baselines.
- On the NIST-20 test set, GrAFF-MS outperforms CFM-ID and NEIMS in both mean cosine similarity and usable-prediction fraction.
- GrAFF-MS runs faster than bond-breaking methods: CPU forward pass ~1.3 core-seconds per spectrum with linear scaling; on a single GPU, ~2.8 ms per spectrum for NIST-20 with batch 512.
- The approach scales better with molecular weight than bond-breaking (e.g., for >500 Da, ~16x faster).
- Predictions remain interpretable in terms of formulas and can distinguish very similar compounds, with human-like errors in challenging cases.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.