BioGeek commited on
Commit
e776c9c
·
verified ·
1 Parent(s): a15665c

Add README.md

Browse files
Files changed (1) hide show
  1. README.md +98 -14
README.md CHANGED
@@ -48,16 +48,68 @@ public PRIDE submissions, used to pretrain and evaluate InstaNovo-FM.
48
 
49
  ## Layout
50
 
51
- Spectra are grouped into three confidence tiers, and each tier is published in two
52
- forms:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
  ```
55
- splits/lcfm/ by_project/lcfm/
56
- splits/mcfm/ by_project/mcfm/
57
- splits/hcfm/ by_project/hcfm/
58
- peptide_registry.parquet
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  ```
60
 
 
 
 
 
61
  ### `splits/` — start here
62
 
63
  `train`, `test` and `valid` parquet, exactly as the model consumed them. The
@@ -65,6 +117,11 @@ partitions are **peptide-disjoint** 80/10/10: a peptide sequence appears in only
65
  of the three, so evaluation does not reward memorisation. Rows are shuffled and have
66
  passed the quality filters below.
67
 
 
 
 
 
 
68
  Use this to reproduce or extend the published results.
69
 
70
  ### `by_project/` — the input the splits came from
@@ -85,8 +142,10 @@ Use this to apply different quality criteria, or to re-derive the partitions wit
85
  | precursor *m/z* | <= 2000 |
86
  | modification annotation | only if resolvable to a UNIMOD identifier |
87
 
88
- A null in any numeric field **passes** its condition, so dropping nulls yields a
89
- different dataset. Measured on this corpus there are none, so it does not bite today.
 
 
90
 
91
  Measured effect on LCFM (184,607,213 -> 181,777,591 rows, 98.5% kept): retention time
92
  removes ~2.54 M, the unresolved-modification condition ~385 k, lower offset 8,147, and
@@ -108,11 +167,32 @@ or to your own spectra, to keep a held-out set genuinely held out.
108
  Join on **`registry_key`** — not on `sequence`, and not on `unmodified_peptide`:
109
 
110
  ```python
111
- import polars as pl
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
 
113
- runs = pl.read_parquet("by_project/lcfm/PXD000561/<run>.parquet")
114
- registry = pl.read_parquet("peptide_registry.parquet")
115
- labelled = runs.join(registry, left_on="registry_key", right_on="peptide", how="left")
 
 
116
  ```
117
 
118
  `registry_key` is `unmodified_peptide` with every `I` rewritten to `L`, which is the
@@ -188,13 +268,17 @@ by_project/lcfm/PXD012345/<instrument-run-name>.parquet
188
 
189
  ## Versioning
190
 
191
- Pin a release rather than tracking `main`, so results stay reproducible:
 
 
192
 
193
  ```python
194
  from datasets import load_dataset
195
- ds = load_dataset("InstaDeepAI/InstaNovo", "hcfm_splits", revision="v1.0")
196
  ```
197
 
 
 
198
  ## Citation
199
 
200
  See the InstaNovo-FM manuscript. Code, including the pipeline that produced these
 
48
 
49
  ## Layout
50
 
51
+ Spectra are grouped into three **confidence tiers**. Each is a Foundational Model
52
+ dataset named for how stringently its peptide-spectrum matches (PSMs) were filtered:
53
+ **LCFM** (Low), **MCFM** (Medium) and **HCFM** (High). The names are relative, not
54
+ absolute — every labelled tier consists of high-confidence PSMs, and "low confidence"
55
+ marks LCFM as the broadest, least stringently filtered one, from which the stricter
56
+ subsets are derived. They are nested: HCFM ⊂ MCFM ⊂ LCFM. A fourth tier, **ACFM** (All
57
+ Confidence), is the unlabelled superset and is not published here.
58
+
59
+ Each tier is published twice, once under `splits/` and once under `by_project/`.
60
+ Which you want depends on whether you are consuming the corpus or rebuilding it:
61
+
62
+ - **`splits/`** — the train/validation/test partitions the model actually consumed:
63
+ quality-filtered, shuffled, and peptide-disjoint. Take this to reproduce or extend
64
+ the published results.
65
+ - **`by_project/`** — the same tier *before* filtering and splitting, one directory per
66
+ PRIDE accession. Take this to apply your own quality criteria or derive your own
67
+ partitions, which `splits/` cannot support because the filtering is lossy.
68
+
69
+ The tier sits *inside* the folder rather than above it — `splits/lcfm/`, not
70
+ `lcfm/splits/`. That nesting is deliberate: it means a download pattern like `--include
71
+ "by_project/*"` cannot stray outside the folder you named. Nested the other way,
72
+ `lcfm/*` would have matched both folders at once and quietly handed you ~900 GB
73
+ containing two overlapping copies of the same spectra, one filtered and one not.
74
 
75
  ```
76
+ InstaDeepAI/InstaNovo
77
+ │
78
+ ├── splits/ FILTERED · SHUFFLED · PEPTIDE-DISJOINT
79
+ │ ├── hcfm/ 11 files · 11.4 GB · 3,670,113 rows
80
+ │ │ ├── hcfm-train-00000-of-00007.parquet … 00006-of-00007
81
+ │ │ ├── hcfm-validation-00000-of-00001.parquet
82
+ │ │ └── hcfm-test-00000-of-00003.parquet … 00002-of-00003
83
+ │ ├── mcfm/ 44 files · 52.5 GB · 18,255,265 rows
84
+ │ │ ├── mcfm-train-00000-of-00029.parquet … 00028-of-00029
85
+ │ │ ├── mcfm-validation-00000-of-00001.parquet
86
+ │ │ └── mcfm-test-00000-of-00014.parquet … 00013-of-00014
87
+ │ └── lcfm/ 454 files · 467.1 GB · 181,777,591 rows
88
+ │ ├── lcfm-train-00000-of-00293.parquet … 00292-of-00293
89
+ │ ├── lcfm-validation-00000-of-00019.parquet … 00018-of-00019
90
+ │ └── lcfm-test-00000-of-00142.parquet … 00141-of-00142
91
+ │
92
+ ├── by_project/ COMPLETE TIER · NOT FILTERED · NOT SPLIT
93
+ │ ├── hcfm/ 15,166 files · 11.4 GB · 3,684,448 rows
94
+ │ │ ├── PXD000561/ 82 accessions in every tier
95
+ │ │ │ ├── Adult_Adrenalgland_Gel_Elite_49_f01.parquet
96
+ │ │ │ └── … one file per instrument run
97
+ │ │ └── PXD000865/ …
98
+ │ ├── mcfm/ 15,244 files · 51.7 GB · 18,422,236 rows
99
+ │ │ └── PXD000561/ … same runs, fewer rows each
100
+ │ └── lcfm/ 15,286 files · ~450 GB · 184,607,213 rows
101
+ │ └── PXD000561/ …
102
+ │
103
+ ├── peptide_registry.parquet 5,613,657 peptides and their split
104
+ │
105
+ └── manifests/
106
+ └── empty_runs.csv 162 runs with no PSMs at their threshold
107
  ```
108
 
109
+ **Pick one tier, from one folder.** Because the tiers are nested, a second tier
110
+ re-downloads the same spectra at a stricter threshold — and `splits/*` or
111
+ `by_project/*` fetches all three, roughly 531 GB and 510 GB.
112
+
113
  ### `splits/` — start here
114
 
115
  `train`, `test` and `valid` parquet, exactly as the model consumed them. The
 
117
  of the three, so evaluation does not reward memorisation. Rows are shuffled and have
118
  passed the quality filters below.
119
 
120
+ `hcfm_splits`: 2,459,391 train / 178,997 validation / 1,031,725 test. The 80/10/10 ratio
121
+ is over peptides, not spectra — a peptide's spectra all land in one split, and peptides
122
+ differ in how many spectra they have, so the row proportions differ from the peptide
123
+ proportions.
124
+
125
  Use this to reproduce or extend the published results.
126
 
127
  ### `by_project/` — the input the splits came from
 
142
  | precursor *m/z* | <= 2000 |
143
  | modification annotation | only if resolvable to a UNIMOD identifier |
144
 
145
+ A null in any numeric field **passes** its condition, so a reimplementation that
146
+ discards nulls instead would produce a different dataset. These tiers contain no nulls
147
+ in any filtered field, so the two behave identically here — but the distinction matters
148
+ if you apply the same criteria to new data.
149
 
150
  Measured effect on LCFM (184,607,213 -> 181,777,591 rows, 98.5% kept): retention time
151
  removes ~2.54 M, the unresolved-modification condition ~385 k, lower offset 8,147, and
 
167
  Join on **`registry_key`** — not on `sequence`, and not on `unmodified_peptide`:
168
 
169
  ```python
170
+ from datasets import load_dataset
171
+
172
+ # hcfm is the smallest tier (11.4 GB); swap in mcfm or lcfm when you need more.
173
+ runs = load_dataset("InstaDeepAI/InstaNovo", "hcfm_by_project", split="full")
174
+ registry = load_dataset("InstaDeepAI/InstaNovo", "peptide_registry", split="full")
175
+
176
+ labelled = runs.to_polars().join(
177
+ registry.to_polars(), left_on="registry_key", right_on="peptide", how="left"
178
+ )
179
+ ```
180
+
181
+ Both calls download and cache from the Hub, so nothing needs fetching by hand.
182
+ `to_polars()` materialises the tier in memory, and `mz_array` and `intensity_array`
183
+ dominate that, so call `runs.select_columns(["registry_key", "experiment_name",
184
+ "scan"])` first if you only need the split assignment. To work through one accession at
185
+ a time rather than a whole tier, pass `streaming=True` and filter on `experiment_name`,
186
+ or fetch single files directly:
187
+
188
+ ```python
189
+ from huggingface_hub import hf_hub_download
190
 
191
+ path = hf_hub_download(
192
+ "InstaDeepAI/InstaNovo",
193
+ "by_project/hcfm/PXD000561/Adult_Adrenalgland_Gel_Elite_49_f01.parquet",
194
+ repo_type="dataset",
195
+ )
196
  ```
197
 
198
  `registry_key` is `unmodified_peptide` with every `I` rewritten to `L`, which is the
 
268
 
269
  ## Versioning
270
 
271
+ `v0.1` is the first release, and the one the paper's results were produced from. Pin it
272
+ rather than tracking `main`, so a later addition to the corpus cannot change what you
273
+ fetch:
274
 
275
  ```python
276
  from datasets import load_dataset
277
+ ds = load_dataset("InstaDeepAI/InstaNovo", "hcfm_splits", revision="v0.1")
278
  ```
279
 
280
+ `main` moves as tiers are extended or corrected; a tag does not.
281
+
282
  ## Citation
283
 
284
  See the InstaNovo-FM manuscript. Code, including the pipeline that produced these