FACET: Feasibility-Automaton Complete Enumeration and Truncation-Free Scoring of Molecular Formulas from MS/MS
Organizations: University of North Carolina at Charlotte, Charlotte, NC 28223, USA
Abstract
Determining the neutral molecular formula of a precursor ion from its tandem mass (MS/MS) spectrum is the first step in identifying an unknown small molecule. Existing methods trade recall, whether the correct formula is among the candidates, against the cost of examining each candidate. Methods that examine each candidate in depth must first shorten the list, by limiting element counts or truncating it, and that is where the correct formula is lost. End-to-end regressors are fast but guarantee neither validity nor recall. We present FACET, which separates deciding which formulas to consider from deciding which one to choose. A feasibility automaton builds a formula one element count at a time and admits exactly the formulas that fit the precursor mass and satisfy the ring-and-double-bond and valence constraints. Run as an exhaustive search, it enumerates the complete feasible set, so every candidate is valid and recall is fixed by the chemical constraints rather than by a trained model. A small neural scoring head then ranks every feasible formula from one pass of a pretrained spectrum encoder, so no candidate is discarded. On the NPLIB1 benchmark FACET reaches top-1 accuracies of with the adduct known and with it unknown, compared with and for the strongest established method, and its recall is the highest. On the external CASMI 2022 set its recall is , and with the adduct unknown it is the most accurate of the methods compared.
Figures & tables
| Method | Candidates | Scoring | Valid | Recall guarantee |
|---|---|---|---|---|
| SIRIUS 6 | mass decomposition below and bottom-up assembly from fragment formulas at every mass | a fragmentation tree for each candidate, of which the best are kept | yes | no |
| BUDDY | formulas retrieved by mass from a bundled database of million, and formulas assembled from fragment and neutral-loss formulas | machine-learned features of each candidate’s fragment explanations | yes | no |
| MIST-CF | external decomposition by SIRIUS, at most one atom of each halogen | subformula-annotated peaks for the candidates kept by a learned formula filter | yes | no |
| FIDDLE | none, as the formula is regressed directly | refinement of the predicted formula | no | no |
| FACET | complete enumeration of the feasible set by the feasibility automaton | every feasible formula, scored by a small head on one shared spectrum encoding | yes | yes |
| Adduct | Method | Top-1 | Top-2 | Top-3 | Recall |
|---|---|---|---|---|---|
| Known | SIRIUS | 0.599 | 0.721 | 0.780 | 0.912 |
| FIDDLE | 0.641 | 0.667 | 0.675 | 0.678 | |
| BUDDY | 0.736 | 0.767 | 0.776 | 0.789 | |
| MIST-CF | 0.766 | 0.847 | 0.879 | 0.959 | |
| FACET | 0.859 | 0.896 | 0.914 | 0.982 | |
| Unknown | SIRIUS | 0.448 | 0.540 | 0.574 | 0.905 |
| Subset | SIRIUS | FIDDLE | BUDDY | MIST-CF | FACET | |
|---|---|---|---|---|---|---|
| All spectra | 0.599 | 0.641 | 0.736 | 0.766 | 0.859 | |
| 0.630 | 0.614 | 0.702 | 0.751 | 0.833 | ||
| 0.427 | 0.670 | 0.751 | 0.768 | 0.897 | ||
| 0.393 | 0.873 | 0.847 | 0.833 | 0.973 | ||
| 0.695 | 0.760 | 0.940 | 0.892 | 0.958 | ||
| 0.571 | 0.314 | 0.914 | 0.657 | 0.943 |
| FACET (in-process) | SIRIUS | ||
|---|---|---|---|
| thread | threads | cores | |
| Formulas returned | 8.2M | 8.2M | 9.1M |
| Formulas per CPU second | 160k | 120k | 125k |
| Wall-clock time | 51 s | 16 s | 48 s |
| Variant | Top-1 | Recall |
|---|---|---|
| Enumeration budget, adduct known | ||
| FACET, formulas | 0.859 | 0.982 |
| formulas | 0.853 | 0.969 |
| Fusion, adduct unknown | ||
| FACET, trained on NPLIB1 | 0.729 | 0.994 |
| without the prior | 0.719 | 0.994 |
| NPLIB1 (in domain) | CASMI 2022 (external) | ||||
| Method | Training set | known | unknown | known | unknown |
| SIRIUS | distributed | 0.599 | 0.448 | 0.780 | 0.620 |
| BUDDY | distributed | 0.736 | 0.299 | 0.790 | 0.414 |
| MIST-CF | NPLIB1 | 0.766 | 0.660 | 0.820 | 0.651 |
| FACET | NPLIB1 | 0.859 | 0.729 | 0.814 | 0.766 |
| MIST-CF | NIST+NPLIB1 | 0.832 | 0.681 | 0.881 | 0.736 |
Appendix figures & tables18 assets
Supplementary material from the paper’s appendix.
Appendix
| Symbol | Meaning |
|---|---|
| tandem mass spectrum: precursor and fragment peaks with and intensity , | |
| , | adduct, from the set of allowed adducts, and the mass shift it introduces |
| ordered element set, carbon first and hydrogen last | |
| , , | monoisotopic mass, valence and maximum count of element |
| , | molecular formula as a vector of element counts; the correct formula |
| neutral monoisotopic mass of |
| Element | Mass before (Da) | Room (Da) | Admissible counts | Count taken |
|---|---|---|---|---|
| C | 0.000 | 334.225 | 0–27 | 20 |
| N | 240.000 | 94.225 | 0–6 | 0 |
| O | 240.000 | 94.225 | 0–5 | 4 |
| P | 303.980 | 30.245 | 0 | 0 |
| S | 303.980 | 30.245 | 0 | 0 |
| Cl | 303.980 | 30.245 | 0 | 0 |
| Adduct known | Adduct unknown | |||
|---|---|---|---|---|
| Route | Share (%) | Recall | Share (%) | Recall |
| exhaustive enumeration | 99.59 | 0.984 | 98.36 | 0.997 |
| enumeration, relaxed tolerance | 0.00 | — | 0.91 | 1.000 |
| constrained beam search | 0.41 | 0.444 | 0.73 | 0.625 |
| Precursor | Spectra | Median | 90th percentile | Largest | Above (%) |
|---|---|---|---|---|---|
| 141 | 22 | 77 | 226 | 0 | |
| 200–400 | 1,072 | 364 | 1,642 | 10,513 | 58 |
| 400–600 | 719 | 2,288 | 9,600 | 87,397 | 97 |
| 600–800 | 198 | 24,870 | 163,076 | 1,042,603 | 100 |
| 55 | 362,367 | 1,552,008 | 1,997,469 | 100 |
| Module | Role | Parameters (M) |
|---|---|---|
| DreaMS encoder | spectrum embeddings , ; once per spectrum | |
| Autoregressive decoder | beam-search fallback, log-likelihood | |
| Scoring head | score of every candidate | |
| Auxiliary head | atom count, mass and H/C regression | |
| Adduct head | adduct posterior | |
| Total |
| Setting | Value |
|---|---|
| Optimizer | Adam, learning rate , weight decay |
| Encoder learning rate | the decoder learning rate |
| Batch size; epochs | spectra; at most , early stopping after epochs without improvement |
| Loss weights | , , |
| Label smoothing | on the decoder cross-entropy, on the ranking loss |
| Automaton mask | soft for epochs, annealed to hard over the next |
| Adduct | Training | Validation | Test | Total |
|---|---|---|---|---|
| 5,785 | 588 | 1,657 | 8,030 | |
| 741 | 69 | 188 | 998 | |
| 507 | 61 | 150 | 718 | |
| 497 | 43 | 167 | 707 | |
| 142 | 12 | 35 | 189 | |
| 41 | 1 | 5 | 47 |
| Instrument | Training | Validation | Test | Total |
|---|---|---|---|---|
| Bruker Q-ToF | 2,478 | 264 | 716 | 3,458 |
| Q-ToF, other | 1,598 | 136 | 410 | 2,144 |
| Orbitrap | 1,021 | 102 | 338 | 1,461 |
| ion trap | 61 | 9 | 21 | 91 |
| FT-ICR | 1 | 0 | 0 | 1 |
| not annotated | 2,568 | 266 | 720 | 3,554 |
| Element | Share of formulas (%) | Largest count | FACET bound |
|---|---|---|---|
| N | 51.9 | 11 | 15 |
| O | 96.0 | 27 | 33 |
| P | 3.0 | 3 | 6 |
| S | 9.0 | 6 | 9 |
| Cl | 6.6 | 4 | 7 |
| F | 3.2 | 17 | 21 |
| Adduct | Method | Top-1 | Top-2 | Top-3 | Top-5 | Top-10 | Recall |
|---|---|---|---|---|---|---|---|
| known | SIRIUS | 0.599 | 0.721 | 0.780 | 0.833 | 0.873 | 0.912 |
| FIDDLE | 0.641 | 0.667 | 0.675 | 0.678 | 0.678 | 0.678 | |
| BUDDY | 0.736 | 0.767 | 0.776 | 0.783 | 0.788 | 0.789 | |
| MIST-CF | 0.766 | 0.847 | 0.879 | 0.907 | 0.932 | 0.959 | |
| FACET | 0.859 | 0.896 | 0.914 | 0.931 | 0.946 | 0.982 | |
| unknown | SIRIUS | 0.448 | 0.540 | 0.574 | 0.655 | 0.750 | 0.905 |
| Adduct known | Adduct unknown | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Precursor | Top-1 | Top-3 | Top-10 | Recall | Top-1 | Top-3 | Top-10 | Recall | |
| 536 | 0.924 | 0.961 | 0.987 | 0.996 | 0.841 | 0.951 | 0.983 | 0.996 | |
| 300–600 | 1,396 | 0.860 | 0.919 | 0.954 | 0.991 | 0.704 | 0.898 | 0.942 | 0.998 |
| 600–800 | 198 | 0.768 | 0.854 | 0.864 | 0.909 | 0.687 | 0.798 | 0.864 | 0.995 |
| 64 | 0.562 | 0.609 | 0.688 | 0.891 | 0.469 | 0.594 | 0.641 | 0.891 | |
| Subset | SIRIUS | FIDDLE | BUDDY | MIST-CF | FACET | |||
|---|---|---|---|---|---|---|---|---|
| all spectra | 2,194 | 0.599 | 0.641 | 0.736 | 0.766 | 0.859 | ||
| 1,650 | 0.630 | 0.614 | 0.702 | 0.751 | 0.833 | |||
| 185 | 0.427 | 0.670 | 0.751 | 0.768 | 0.897 | |||
| 150 | 0.393 | 0.873 | 0.847 | 0.833 | 0.973 | |||
| 167 | 0.695 | 0.760 | 0.940 | 0.892 | 0.958 | 0.003 | ||
| 35 | 0.571 | 0.314 | 0.914 | 0.657 | 0.943 | 0.002 |
| Adduct known | Adduct unknown | |||
|---|---|---|---|---|
| Element | Signed | Absolute | Signed | Absolute |
| C | 0.351 | 0.373 | ||
| N | 0.227 | 0.217 | ||
| O | 0.282 | 0.414 | ||
| P | 0.021 | 0.021 | ||
| S | 0.057 | 0.065 | ||
| Setting | Exchange (top-1 correct) | Gap (mDa) | Count | Share of errors (%) |
|---|---|---|---|---|
| adduct known | 2.68 | 28 | 10.1 | |
| adduct known | 1.34 | 26 | 9.4 | |
| adduct known | 1.34 | 13 | 4.7 | |
| adduct known | 1.54 | 12 | 4.3 | |
| adduct known | 0.49 | 11 | 4.0 | |
| adduct known | OFH | 1.14 | 9 | 3.3 |
| Theoretical | Measured | Inconsistent | |||||
| Adduct | Method | Top-1 | Recall | Top-1 | Recall | Top-1 | Recall |
| known | SIRIUS | 0.635 | 0.931 | 0.556 | 0.913 | 0.029 | 0.088 |
| FIDDLE | 0.716 | 0.723 | 0.529 | 0.623 | 0.000 | 0.000 | |
| BUDDY | 0.841 | 0.879 | 0.569 | 0.651 | 0.059 | 0.059 | |
| MIST-CF | 0.793 | 0.966 | 0.723 | 0.947 | 0.618 | 0.912 | |
| FACET | 0.926 | 0.996 | 0.771 | 1.000 | 0.000 | 0.000 | |
| All spectra | Measured precursor | |
|---|---|---|
| 1 | 0.709 | 0.170 |
| 64 | 0.881 | 0.659 |
| 128 | 0.923 | 0.778 |
| 256 | 0.954 | 0.869 |
| 512 | 0.974 | 0.925 |
| 1,024 | 0.984 | 0.953 |
| Correct formula | Adduct | Rank | FACET top three | MIST-CF top-1 | |||
| (a) |
Mass Spectrometry
Mass spectrometry measures ion mass-to-charge patterns to identify and quantify molecules, with AI linking spectra to structures, peptides, and biological signals.
See all 40 papers