File size: 4,911 Bytes
d4f891c
 
 
 
 
 
 
 
 
 
 
62ccb2c
 
d4f891c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62ccb2c
d4f891c
 
 
 
 
 
 
62ccb2c
d4f891c
62ccb2c
d4f891c
62ccb2c
d4f891c
 
 
 
 
 
62ccb2c
d4f891c
62ccb2c
d4f891c
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
license: mit
task_categories:
- feature-extraction
tags:
- mass-spectrometry
- molecular-structure-elucidation
- cheminformatics
pretty_name: FragScape data
---

# FragScape data

Derived data from FragScape, a study of **formula -> molecular structure** generation and
of same-formula candidate ranking from MS/MS spectra. Code:
<https://github.com/GainGod-Xu/fragscape>.

The project's measurements are archived here together with the inputs needed to
reproduce them. Raw third-party data is **not** mirrored; see *Not included* below.

## What is here

| path | size | what it is |
|---|---|---|
| `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 |
| `mols/holdout_keys.txt` | 367 KB | InChIKey14s held out of the corpus. Every number reported on held-out molecules uses this file |
| `mols/recovery_eval.tsv` | 1.5 MB | the 2,470 molecules of the recovery evaluation |
| `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 |
| `cands/` | 136 MB | the smaller pool used before `decoys/` replaced it (median 2 candidates, 44% singletons - kept only so earlier numbers remain checkable) |
| `results/` | 269 MB | every evaluation output, one JSON per run, plus the MSn scoring sweeps |
| `logs/` | 68 MB | Slurm stdout/stderr for the runs behind those JSONs, including the `RESULT` lines |

Model weights are in the companion repo
[`Xu-AI4Science/fragscape`](https://huggingface.co/Xu-AI4Science/fragscape).

## The three measurements worth knowing about

These are the reasons the data is shaped the way it is. All ranks break **ties against
the truth**, and every scorer has a **shuffled-input control** (each spectrum paired
with a different molecule's) because a scorer that ignores its input otherwise looks
fine.

**1. Fragment enumeration beats every published learned ranker on same-formula pools,
with no training at all.** On 400 held-out MassSpecGymMSn molecules, official candidate
pools (median 245), MS2 only:

| scorer | top-1 | top-5 | top-10 | top-20 | median rank |
|---|---|---|---|---|---|
| fragment enumeration, real spectra | **22.25%** [18.45, 26.58] | 57.75% | 72.75% | 84.50% | 4 |
| fragment enumeration, shuffled spectra | 1.25% | - | 9.00% | - | 88 |

The score is explained intensity: enumerate every fragment up to 2 bond breaks, match
each peak within max(10 ppm, 0.005 Da) allowing +-2 H, sum the matched intensity. For
reference, the best published number on the equivalent formula-restricted setting of the
MassSpecGym benchmark (256 same-formula candidates) is MIST's 9.57% top-1. Those are
different test molecules, so this is not a like-for-like claim - the matched comparison
on MassSpecGym's own test fold was never run.

**2. The learned contrastive ranker never read the spectrum.** Two arms (frozen formula
LM tower; trainable 5-layer GINE tower) reached 1.75-3.75% top-1, at or below the
benchmark's *random* baseline of 3.06%. Blinding the spectrum changed top-1 by between
-0.47 and +0.03 pp, i.e. not at all. The checkpoints are archived so this is checkable.

**3. Coverage, not ranking, is the ceiling.** Sampling the formula-conditioned prior
1,000 times covers the true molecule for 5-6% of spectra, and `top-1 <= coverage` is
arithmetic. Scaling the prior from 25M to 110M parameters improved held-out loss
0.3669 -> 0.3366 and moved recovery@1000 from 3.60% to 5.08%, but left **recovery@1
unchanged at 0.04%** (1 molecule in 2,440). The corpus axis is flat: 5.5M / 13.2M /
44.0M / 132.1M molecules give 3.32 / 3.81 / 3.36 / 3.60% at 1,000 draws. More draws is
the only axis that moves, and it is sublinear - 1.0 / 4.0 / 13.0% at 100 / 1k / 10k.

## Not included

Third-party data is left at its source rather than mirrored:

- **MassSpecGym** and **MassSpecGymMSn** (spectra, splits, official retrieval candidate
  lists): HuggingFace dataset `roman-bushuiev/MassSpecGym`. The two raw dumps the corpus
  was built from are `data/molecules/MassSpecGym1.5_pretraining_molecules_50M_tani070.txt`
  and `data/molecules/candidate_pools/MassSpecGym_retrieval_molecules_pubchem_118M.tsv`.
- The **tokenized corpus cache** (13 GB) is regenerable from `mols/formula_corpus.tsv.gz`
  with `scripts/sbatch_tokenize_corpus.sh`.

## Citing the benchmark

Bushuiev et al., *MassSpecGym: A benchmark for the discovery and identification of
molecules*, Advances in Neural Information Processing Systems 37 (NeurIPS 2024),
Datasets and Benchmarks Track. The 9.57% and 3.06% figures above are from its Table 5,
bonus chemical formulae setting.