Xu-AI4Science commited on
Commit
d4f891c
·
verified ·
1 Parent(s): 3e4aecf

Archive README.md

Browse files
Files changed (1) hide show
  1. README.md +80 -20
README.md CHANGED
@@ -1,28 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
1
  # FragScape data
2
 
3
- Companion data for FragScape: de novo molecular structure generation from MS/MS via
4
- fragment-peak hypergraph diffusion. Code: https://github.com/GainGod-Xu/fragscape
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
- ## coverage/
 
 
 
 
 
 
7
 
8
- Per-spectrum measurements of how many annotated peaks a connected induced subgraph of
9
- the **true** structure can account for, as a function of the cut-cost budget (the number
10
- of bonds that must be broken to detach the fragment, equal to its boundary size) and the
11
- hydrogen tolerance. Measured against the true structure, so these are upper bounds on
12
- what any model can be asked to explain.
13
 
14
- - `coverage_msg.json` -- MassSpecGym, 7987 spectra
15
- - `coverage_canopus.json` -- NPLIB1 (CANOPUS), 3997 spectra
16
 
17
- Each file has `summary` (aggregates, also mirrored in the git repo) and `records` (one
18
- entry per spectrum). The records are here rather than in git because they are 49 MB and
19
- 26 MB.
 
 
 
20
 
21
- Headline: coverage saturates near **73% on both benchmarks** however far the hydrogen
22
- tolerance is relaxed, so roughly a quarter of annotated peaks correspond to no connected
23
- induced subgraph of the true structure at any budget. The customary budget of three
24
- broken bonds reaches 59.8% (MassSpecGym) and 54.0% (NPLIB1); four reaches 65.1% and
25
- 61.5%, which is the operating point, since five roughly doubles assignment ambiguity for
26
- 2-3 further points.
27
 
28
- Generated by `scripts/measure_peak_coverage.py` (Slurm jobs 48921851, 48921852).
 
 
 
 
1
+ ---
2
+ license: mit
3
+ task_categories:
4
+ - feature-extraction
5
+ tags:
6
+ - mass-spectrometry
7
+ - molecular-structure-elucidation
8
+ - cheminformatics
9
+ pretty_name: FragScape data
10
+ ---
11
+
12
  # FragScape data
13
 
14
+ Derived data from FragScape, a study of **formula -> molecular structure** generation and
15
+ of same-formula candidate ranking from MS/MS spectra. Code:
16
+ <https://github.com/GainGod-Xu/fragscape>.
17
+
18
+ The project's measurements are archived here together with the inputs needed to
19
+ reproduce them. Raw third-party data is **not** mirrored; see *Not included* below.
20
+
21
+ ## What is here
22
+
23
+ | path | size | what it is |
24
+ |---|---|---|
25
+ | `mols/formula_corpus.tsv.gz` | 3.9 GB | the 142M-molecule corpus: `SMILES \t formula \t InChIKey14`, one molecule per line, no header. Built from MassSpecGym's 50M pretraining dump plus its 118M PubChem retrieval pool, multi-component entries dropped |
26
+ | `mols/holdout_keys.txt` | 367 KB | InChIKey14s held out of the corpus. Every number reported on held-out molecules uses this file |
27
+ | `mols/recovery_eval.tsv` | 1.5 MB | the 2,470 molecules of the recovery evaluation |
28
+ | `decoys/` | 1.4 GB | same-formula candidate pools built from the corpus: 8,833 heavy-atom formulas, 19,067,059 candidates, median 1,885 per formula, capped at 4,096. `cands.smi` / `cands.keys` / `cands.formula` are line-aligned; `cands_index.json` gives each formula's offset |
29
+ | `cands/` | 136 MB | the smaller pool used before `decoys/` replaced it (median 2 candidates, 44% singletons - kept only so earlier numbers remain checkable) |
30
+ | `results/` | 269 MB | every evaluation output, one JSON per run, plus the MSn scoring sweeps |
31
+ | `logs/` | 68 MB | Slurm stdout/stderr for the runs behind those JSONs, including the `RESULT` lines |
32
+
33
+ Model weights are in the companion repo
34
+ [`Xu-AI4Science/fragscape`](https://huggingface.co/Xu-AI4Science/fragscape).
35
+
36
+ ## The three measurements worth knowing about
37
+
38
+ These are the reasons the data is shaped the way it is. All ranks break **ties against
39
+ the truth**, and every scorer has a **shuffled-input control** (each spectrum paired
40
+ with a different molecule's) because a scorer that ignores its input otherwise looks
41
+ fine.
42
+
43
+ **1. Fragment enumeration beats every published learned ranker on same-formula pools,
44
+ with no training at all.** On 400 held-out MassSpecGymMSn molecules, official candidate
45
+ pools (median 245), MS2 only:
46
+
47
+ | scorer | top-1 | top-5 | top-10 | top-20 | median rank |
48
+ |---|---|---|---|---|---|
49
+ | fragment enumeration, real spectra | **22.25%** [18.45, 26.58] | 57.75% | 72.75% | 84.50% | 4 |
50
+ | fragment enumeration, shuffled spectra | 1.25% | - | 9.00% | - | 88 |
51
+
52
+ The score is explained intensity: enumerate every fragment up to 2 bond breaks, match
53
+ each peak within max(10 ppm, 0.005 Da) allowing +-2 H, sum the matched intensity. For
54
+ reference, the best published number on the equivalent formula-restricted setting of the
55
+ MassSpecGym benchmark (256 same-formula candidates) is MIST's 9.57% top-1. Those are
56
+ different test molecules, so this is not a like-for-like claim - the matched comparison
57
+ on MassSpecGym's own test fold was never run.
58
+
59
+ **2. The learned contrastive ranker never read the spectrum.** Two arms (frozen formula
60
+ LM tower; trainable 5-layer GINE tower) reached 1.75-3.75% top-1, at or below the
61
+ benchmark's *random* baseline of 3.06%. Blinding the spectrum changed top-1 by between
62
+ -0.47 and +0.03 pp, i.e. not at all. The checkpoints are archived so this is checkable.
63
 
64
+ **3. Coverage, not ranking, is the ceiling.** Sampling the formula-conditioned prior
65
+ 1,000 times covers the true molecule for 5-6% of spectra, and `top-1 <= coverage` is
66
+ arithmetic. Scaling the prior from 25M to 110M parameters improved held-out loss
67
+ 0.3669 -> 0.3366 and moved recovery@1000 from 3.60% to 5.08%, but left **recovery@1
68
+ unchanged at 0.04%** (1 molecule in 2,440). The corpus axis is flat: 5.5M / 13.2M /
69
+ 44.0M / 132.1M molecules give 3.32 / 3.81 / 3.36 / 3.60% at 1,000 draws. More draws is
70
+ the only axis that moves, and it is sublinear - 1.0 / 4.0 / 13.0% at 100 / 1k / 10k.
71
 
72
+ ## Not included
 
 
 
 
73
 
74
+ Third-party data is left at its source rather than mirrored:
 
75
 
76
+ - **MassSpecGym** and **MassSpecGymMSn** (spectra, splits, official retrieval candidate
77
+ lists): HuggingFace dataset `roman-bushuiev/MassSpecGym`. The two raw dumps the corpus
78
+ was built from are `data/molecules/MassSpecGym1.5_pretraining_molecules_50M_tani070.txt`
79
+ and `data/molecules/candidate_pools/MassSpecGym_retrieval_molecules_pubchem_118M.tsv`.
80
+ - The **tokenized corpus cache** (13 GB) is regenerable from `mols/formula_corpus.tsv.gz`
81
+ with `scripts/sbatch_tokenize_corpus.sh`.
82
 
83
+ ## Citing the benchmark
 
 
 
 
 
84
 
85
+ Bushuiev et al., *MassSpecGym: A benchmark for the discovery and identification of
86
+ molecules*, Advances in Neural Information Processing Systems 37 (NeurIPS 2024),
87
+ Datasets and Benchmarks Track. The 9.57% and 3.06% figures above are from its Table 5,
88
+ bonus chemical formulae setting.