Skip to content

FIDDLE

Summary

FIDDLE (Formula IDentification by Deep LEarning) predicts a small molecule's chemical formula directly from its tandem mass spectrum (MS/MS), the foundational first step of small-molecule identification that constrains downstream structure elucidation. Trained on over 38,000 molecules and 1 million MS/MS spectra from Q-TOF and Orbitrap instruments, it outperforms the top-down (SIRIUS) and bottom-up (BUDDY) state of the art on accuracy — especially for larger molecules, where prior methods degrade sharply — while running roughly 10x faster than BUDDY and 100x faster than SIRIUS [1].

Method

FIDDLE has three stages:

  1. Deep learning formula prediction: the binned MS/MS spectrum (fixed m/z resolution, e.g. 0.2 Da bins up to 1500 Da) is encoded with stacked dilated convolutions using large kernels, giving an extremely large receptive field over the spectrum at low computational cost versus fully-connected layers. Learned spectral features are concatenated with experimental metadata (collision energy, precursor type, experimental precursor m/z) and decoded into a predicted formula vector (per-element atom counts) plus auxiliary predictions (atom count, molecular mass, H/C ratio) via multitask learning. A contrastive loss pulls condition-independent features from spectra of the same molecule together and pushes different molecules apart, aiding convergence.
  2. Breadth-first formula refinement: because the deep learning output need not be a valid or exact-mass-matching formula, a search makes minimal atom-count adjustments to satisfy SENIOR valence rules and match the target mass within instrument-specific tolerance (10 ppm Q-TOF, 5 ppm Orbitrap), producing k candidate formulas (default k = 5). This same refinement step can expand candidate lists from other predictors (e.g., SIRIUS, BUDDY) as well.
  3. Confidence scoring: a second deep learning model reuses the formula-identification model's learned MS/MS features to score and rank the k candidates.

Performance

  • Overall accuracy: top-1 and top-5 accuracy of 88.3% and 93.6% on the internal test set, exceeding SIRIUS and BUDDY by >10 percentage points.
  • Large-molecule robustness: for molecules >800 Da, FIDDLE held top-1 accuracy at 0.642 (Q-TOF) and 0.813 (Orbitrap), while BUDDY dropped to 0.427/0.684 and SIRIUS to 0.187/no-output-within-timeout. At top-5, FIDDLE reached 0.754 (Q-TOF) and 0.971 (Orbitrap) on large molecules versus BUDDY's 0.489/0.684 and SIRIUS's 0.178/no-result.
  • Small-molecule accuracy: FIDDLE also edges out both baselines on ≤800 Da molecules (top-1: 0.906 Q-TOF, 0.881 Orbitrap).
  • Complementarity: merging BUDDY's candidates into FIDDLE's pool further improves accuracy, indicating the two methods succeed on different compound subsets — at some added computational cost.
  • Generalization to unseen formulas: splitting train/test by unique chemical formula (rather than by molecule) — forcing prediction of formulas never seen during training — cost only ~10% accuracy relative to the standard molecule-based split.
  • Noise robustness: under Gaussian-noise-perturbed spectra, FIDDLE retained >90% top-5 accuracy at the highest noise level tested (95.0% Q-TOF, 93.3% Orbitrap), versus BUDDY (93.5%/75.4%) and SIRIUS (52.5%/63.1%).
  • External metabolomics validation: on external metabolomics datasets, FIDDLE reached top-5 accuracies of 75.1% (positive mode) and 66.2% (negative mode), improving to 80.0% and 73.8% when ensembled with SIRIUS and BUDDY.

Limitations

Deep learning models are inherently less interpretable than fragmentation-tree-based methods like SIRIUS; the authors provide a SHAP-based interpretation approach (Supplementary Note 4), but binned spectral resolution limits its ability to attribute predictions to specific atoms or fragments. Performance also trades off against robustness on chimeric (mixed-compound) spectra.

Availability

Source code: github.com/JosieHong/FIDDLE (Apache 2.0). Pre-trained Q-TOF and Orbitrap models are distributed via GitHub releases, and a command-line tool msfiddle is available on PyPI.

See Also

  • Small-Molecule Structure Elucidation — the broader task for which formula identification is the constraining first step.
  • MIST — a transformer-based mass-spectrometry tool addressing the related task of molecular structure elucidation.

Citations

[1] Hong, Y., Li, S., Ye, Y., & Tang, H. (2025). FIDDLE: a deep learning method for chemical formulas prediction from tandem mass spectra. Nature Communications, 16, 11102.