timodonnell commited on
Commit
25b024b
·
verified ·
1 Parent(s): 934edb4

Add snapshot README documenting contents, provenance, and caveats

Browse files
Files changed (1) hide show
  1. processed/pdb-2026-08-08/README.md +340 -0
processed/pdb-2026-08-08/README.md ADDED
@@ -0,0 +1,340 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Helico processed PDB snapshot — `pdb-2026-08-08`
2
+
3
+ Tokenized, model-ready structures for [Helico](https://github.com/Open-Athena/helico),
4
+ an AlphaFold3 clone built from scratch in PyTorch. This directory is one
5
+ **immutable snapshot**: 236,326 structures derived from the RCSB PDB archive,
6
+ tokenized in AF3 convention and pickled for direct loading by the training
7
+ dataloader.
8
+
9
+ Snapshots are never edited in place. `../latest.json` names the current one per
10
+ source type; this snapshot has been current since 2026-08-08.
11
+
12
+ | | |
13
+ |---|---|
14
+ | Snapshot id | `pdb-2026-08-08` |
15
+ | Created (UTC) | 2026-08-08T08:47:13Z |
16
+ | Structures | 236,326 |
17
+ | Source code | [`Open-Athena/helico`](https://github.com/Open-Athena/helico) @ `fa40683` |
18
+ | Schema version | 1 |
19
+
20
+ What distinguishes this snapshot from its predecessor (`pdb-2026-04-22`) is that
21
+ every structure carries **pyconfind residue–residue contacts**. See
22
+ [Contacts](#residueresidue-contacts) below.
23
+
24
+ ---
25
+
26
+ ## Files
27
+
28
+ | File | Size | Contents |
29
+ |---|---|---|
30
+ | `structures.tar.00` … `.03` | 83.4 GB total | Split tar of 236,326 `.pkl` files |
31
+ | `manifest.json.gz` | 90.6 MB | Metadata for every structure (~1.9 GB uncompressed) |
32
+ | `rcsb_raw_msa_index.pkl` | 15.2 MB | Offset index into `rcsb_raw_msa.tar` (151,403 entries) |
33
+ | `openfold_raw_msa_index.pkl` | 11.2 MB | Offset index into `openfold_raw_msa.tar` (268,778 entries) |
34
+ | `SOURCE.json` | 937 B | Machine-readable provenance record |
35
+
36
+ ⚠️ **`ccd_cache.pkl` is not in this directory.** It lives one level up at
37
+ [`processed/ccd_cache.pkl`](../ccd_cache.pkl) (117.8 MB) because it is shared
38
+ across snapshots. You need it for inference and for anything that resolves
39
+ ligand chemistry.
40
+
41
+ ⚠️ **The MSA `.tar` files themselves are not hosted here.** The two index files
42
+ above are offset maps into archives you must obtain separately — see
43
+ [MSA indices](#msa-indices).
44
+
45
+ ### The split tar
46
+
47
+ `structures.tar` is split into 25 GiB chunks because of the Hub's per-file size
48
+ limit. Reassemble by concatenating in order:
49
+
50
+ ```bash
51
+ cat structures.tar.* | tar -xf -
52
+ ```
53
+
54
+ This yields `structures/<subdir>/<pdb_id>.pkl` across ~1,000 subdirectories,
55
+ following the PDB "divided" convention (subdirectory = middle two characters of
56
+ the PDB ID).
57
+
58
+ ---
59
+
60
+ ## Getting the data
61
+
62
+ The supported path installs Helico and lets it resolve everything:
63
+
64
+ ```bash
65
+ git clone https://github.com/Open-Athena/helico && cd helico
66
+ uv pip install -e ".[dev]" # not published to PyPI; install from source
67
+ helico-download # resolves ../latest.json, fetches, extracts
68
+ ```
69
+
70
+ `helico-download` deliberately flattens the snapshot id away, landing files in
71
+ the flat local layout (`<data-dir>/processed/…`) that the training code expects.
72
+ Override the destination with `--data-dir` or the `HELICO_DATA_DIR` env var.
73
+
74
+ Pin this snapshot explicitly rather than following `latest.json`:
75
+
76
+ ```bash
77
+ helico-download --snapshot pdb-2026-08-08
78
+ ```
79
+
80
+ Just the CCD cache (small, sufficient for inference):
81
+
82
+ ```bash
83
+ helico-download --subset ccd-only
84
+ ```
85
+
86
+ ### Reading a structure pickle
87
+
88
+ ⚠️ **These are Python pickles of a Helico dataclass — `helico` must be
89
+ importable to unpickle them**, and pickle carries the usual code-execution
90
+ caveat. There is no framework-agnostic serialization in this snapshot.
91
+
92
+ ```python
93
+ import pickle
94
+ from helico.data import TokenizedStructure # required for unpickling
95
+
96
+ with open("structures/ab/1abc.pkl", "rb") as f:
97
+ s: TokenizedStructure = pickle.load(f)
98
+
99
+ features = s.to_features() # dict of model-ready torch tensors
100
+ ```
101
+
102
+ ---
103
+
104
+ ## What a structure pickle contains
105
+
106
+ Each file holds one `TokenizedStructure`:
107
+
108
+ | Field | Type | Notes |
109
+ |---|---|---|
110
+ | `pdb_id` | `str` | |
111
+ | `tokens` | `list[Token]` | One entry per token — see below |
112
+ | `chain_ids` | `list[str]` | Per token |
113
+ | `entity_types` | `list[str]` | Per token |
114
+ | `chain_sequences` | `dict[str, str]` | chain_id → sequence |
115
+ | `token_bonds` | `list[tuple[int, int]]` | **Sparse** edge list |
116
+ | `contact_edges` | `list[tuple[int, int]]` | **Sparse**; pyconfind contacts |
117
+ | `contact_eligible` | `list[int]` | Tokens pyconfind actually analysed |
118
+
119
+ Each `Token` carries `token_type`, `chain_idx`, `res_idx`, `atom_names`,
120
+ `atom_elements`, `atom_coords` `(N_atoms, 3)`, `ref_coords` from the CCD,
121
+ `res_name`, `entity_id`, `sym_id`, `token_index`, `ref_space_uid`, and
122
+ `atom_charges`.
123
+
124
+ **Tokenization** follows AF3: one token per protein residue, one per
125
+ nucleotide, and one per **heavy atom** for ligands.
126
+
127
+ ### Why `token_bonds` and `contact_edges` are sparse
128
+
129
+ Both are `(N_tok, N_tok)` conceptually and are densified by `to_features()` at
130
+ load time. They are *stored* sparse because a dense tensor is quadratic in token
131
+ count — 400 MB for a ribosome, multiple GB for a capsid. An earlier snapshot
132
+ format stored `token_bonds` densely and drove preprocessing workers to 200+ GB
133
+ RSS. The loader still accepts legacy dense pickles.
134
+
135
+ ---
136
+
137
+ ## The manifest
138
+
139
+ `manifest.json.gz` maps `pdb_id` → metadata for all 236,326 structures. Use it
140
+ to filter the corpus *without* touching the 83 GB of pickles — this is how the
141
+ train/val split is applied.
142
+
143
+ | Field | Notes |
144
+ |---|---|
145
+ | `pdb_id` | |
146
+ | `pickle_path` | Relative to the processed dir |
147
+ | `n_tokens`, `n_atoms`, `n_chains` | |
148
+ | `resolution` | Å; `inf` when unreported |
149
+ | `release_date` | `YYYY-MM-DD`; drives the split |
150
+ | `method` | Experimental method |
151
+ | `entity_types`, `chain_ids` | |
152
+ | `chain_sequences` | chain_id → sequence |
153
+
154
+ ---
155
+
156
+ ## MSA indices
157
+
158
+ The two `.pkl` index files map a tar member name to `(data_offset, data_size)`,
159
+ enabling O(1) random reads into the raw MSA archives by seeking directly to the
160
+ byte offset rather than scanning the tar. Obtain the archives themselves from
161
+ the original locations:
162
+
163
+ - `rcsb_raw_msa.tar` (131 GB) — `https://boltz1.s3.us-east-2.amazonaws.com/rcsb_raw_msa.tar`
164
+ - `openfold_raw_msa.tar` (88 GB) — `https://boltz1.s3.us-east-2.amazonaws.com/openfold_raw_msa.tar`
165
+
166
+ Lookup is **content-addressed by sequence**: a chain finds its alignment under
167
+ `rcsb_raw_msa/{sha256(sequence + "\n")}.a3m.gz`, not by PDB ID.
168
+
169
+ ⚠️ **The OpenFold index is not usable through Helico's current lookup path.**
170
+ Its members are named `{uniprot_accession}.a3m.gz`, and the accession mapping is
171
+ not implemented — the loader only probes the RCSB naming convention. The index
172
+ is published for completeness. Chains with no MSA hit fall back to zeros with
173
+ `has_msa = 0`.
174
+
175
+ ---
176
+
177
+ ## How this snapshot was generated
178
+
179
+ ### 1. Raw inputs
180
+
181
+ | What | Source |
182
+ |---|---|
183
+ | mmCIF archive | `rsync://rsync.rcsb.org::ftp_data/structures/divided/mmCIF/` |
184
+ | Chemical Component Dictionary | `https://files.wwpdb.org/pub/pdb/data/monomers/components.cif` |
185
+ | RCSB MSAs | `https://boltz1.s3.us-east-2.amazonaws.com/rcsb_raw_msa.tar` |
186
+ | OpenFold MSAs | `https://boltz1.s3.us-east-2.amazonaws.com/openfold_raw_msa.tar` |
187
+
188
+ Raw data was fetched directly onto cloud compute rather than mirrored through a
189
+ local machine, and preprocessing ran in the same place — the processed tree was
190
+ never uploaded from a workstation.
191
+
192
+ ### 2. Preprocessing
193
+
194
+ ```bash
195
+ helico-preprocess all <raw> <processed>
196
+ ```
197
+
198
+ For each mmCIF file: parse, drop water and hydrogens, validate chains, and apply
199
+ the filters below; then tokenize and pickle. A manifest is built over everything
200
+ that passed.
201
+
202
+ | Filter | Value |
203
+ |---|---|
204
+ | Resolution | ≤ 9.0 Å (`_refine.ls_d_res_high`, `_em_3d_reconstruction.resolution`, or `_reflns.d_resolution_high`) |
205
+ | Polymer chains | ≥ 1 required |
206
+ | Water, hydrogen | Removed |
207
+
208
+ **252,091 mmCIF files → 236,326 structures passed.**
209
+
210
+ ### 3. Contacts migration
211
+
212
+ This snapshot's contacts were added by re-running only the tokenize-and-pickle
213
+ step over raw data already in place, reusing the existing CCD cache and MSA
214
+ indices. The pass is idempotent — it skips a structure only when its pickle
215
+ already carries contacts — so it could be resumed after interruption. The final
216
+ run found 220,065 structures already migrated, repaired the remaining 16,261,
217
+ and merged the manifest back to 236,326.
218
+
219
+ ### 4. Publishing
220
+
221
+ `structures/` was packed with `tar -cf - | split -b 25G` streamed directly into
222
+ chunks (no intermediate full-size tar), the manifest gzipped, and everything
223
+ uploaded alongside a generated `SOURCE.json`.
224
+
225
+ ---
226
+
227
+ ## Residue–residue contacts
228
+
229
+ Every structure here carries side-chain contacts computed by
230
+ [pyconfind](https://github.com/timodonnell/pyconfind) using the exact
231
+ `contacts-v1` parameters that [MarinFold](https://github.com/Open-Athena/MarinFold)
232
+ uses, so contacts predicted by a MarinFold model mean the same thing as the ones
233
+ stored here.
234
+
235
+ ```
236
+ native_only = True
237
+ contact_distance = 3.0
238
+ dcut = 25.0
239
+ clash_distance = 2.0
240
+ assembly = None # analyse as-is; no bioassembly expansion
241
+ min_contact_degree= 0.001 # pyconfind emits a tail down to ~1e-8
242
+ ```
243
+
244
+ `to_features()` densifies these into a **three-state** `(N_tok, N_tok)` matrix:
245
+
246
+ | State | Meaning |
247
+ |---|---|
248
+ | `PRESENT` | Contact found |
249
+ | `ABSENT` | Both endpoints analysed, no contact found — **a real signal** |
250
+ | `UNKNOWN` | Not knowable |
251
+
252
+ A pair is knowable only when pyconfind analysed both endpoints (protein residues
253
+ only — ligands, nucleotides and modified residues are always `UNKNOWN`) **and**
254
+ the pair is either inter-chain or at least `MIN_SEQ_SEPARATION = 6` apart in
255
+ sequence.
256
+
257
+ The distinction between `ABSENT` and `UNKNOWN` is what `contact_eligible`
258
+ exists to preserve. Measured over real structures, a contact corresponds to
259
+ Cβ–Cβ < 13 Å and a no-contact to > 12 Å, so a fully specified matrix approximates
260
+ a coarse distance matrix.
261
+
262
+ ---
263
+
264
+ ## Train/val split convention
265
+
266
+ The split is applied at load time from `release_date` in the manifest; it is not
267
+ baked into the files. Helico's defaults match AF3, Protenix v1, and
268
+ OpenFold3-preview2 so that metrics are directly comparable:
269
+
270
+ | Split | Rule | Count |
271
+ |---|---|---|
272
+ | Train | `release_date < 2021-09-30` | 170,926 |
273
+ | Val | `2022-05-01 ≤ release_date ≤ 2023-01-12` | 9,716 |
274
+
275
+ Structures released in the 2021-09-30 → 2022-05-01 gap fall in **neither**
276
+ split. That is AF3's deliberate leakage-prevention design, not an oversight.
277
+
278
+ ### ⚠️ A temporal split is not a redundancy split
279
+
280
+ This is the most important caveat for anyone evaluating on the val window. The
281
+ PDB re-deposits the same protein constantly — mutants, different ligands,
282
+ different conditions — so a date cutoff removes almost no *sequence*
283
+ redundancy. Measured against this manifest by exact string matching:
284
+
285
+ - **38.2%** of validation structures have at least one chain sequence appearing
286
+ verbatim in the training set (3,708 of 9,716)
287
+ - **18.4%** have *every* chain sequence verbatim in training
288
+
289
+ Real homology overlap at, say, 30% identity would be considerably higher.
290
+ Validation scores computed on this window therefore substantially reflect recall
291
+ of memorized folds. **Any held-out set built from these files by date needs an
292
+ explicit sequence-identity filter against training before it will support a
293
+ generalization claim.**
294
+
295
+ ### No cluster weighting
296
+
297
+ The corpus is published as-is. There is no AF3-style cluster-based weighted
298
+ sampling, no deduplication, and no per-molecule-type rebalancing applied here —
299
+ Helico's dataloader samples uniformly over the filtered entries. Add your own if
300
+ you need it.
301
+
302
+ ---
303
+
304
+ ## Verification
305
+
306
+ `SOURCE.json` records `fingerprints` for `ccd_cache.pkl` and `manifest.json`.
307
+
308
+ ⚠️ These are SHA-256 over **only the first 64 MB** of each file, not the whole
309
+ thing — full hashes over multi-GB files were too slow at publish time. They are
310
+ adequate to distinguish snapshots, and are **not** integrity checks. The Hub's
311
+ own per-file hashes are authoritative for that.
312
+
313
+ `SOURCE.json` also records `git_sha` `fa40683ea2eea4db890679b9d49d1938cf817132`,
314
+ the commit that produced this snapshot. It lived on a feature branch; the same
315
+ work reached `main` as the squash-merge "Contact-conditioned folding: fold from
316
+ pyconfind contacts instead of MSAs" (#10).
317
+
318
+ ---
319
+
320
+ ## Provenance and terms
321
+
322
+ Structural data derives from the **RCSB PDB**, which distributes its archive
323
+ without copyright restriction (CC0 1.0), and from the **wwPDB Chemical Component
324
+ Dictionary**. Precomputed MSAs originate from archives published by the
325
+ [Boltz](https://github.com/jwohlwend/boltz) project; the OpenFold alignments in
326
+ turn derive from the [OpenFold](https://github.com/aqlaboratory/openfold)
327
+ project. Contacts are computed with
328
+ [pyconfind](https://github.com/timodonnell/pyconfind).
329
+
330
+ If you use this snapshot, please cite the underlying PDB entries and the
331
+ upstream projects above. No separate license is declared on this repository;
332
+ usage follows the terms of those upstream sources.
333
+
334
+ ---
335
+
336
+ ## Related
337
+
338
+ - Code, training recipes, and full documentation: [`Open-Athena/helico`](https://github.com/Open-Athena/helico)
339
+ - Model weights: [`timodonnell/helico`](https://huggingface.co/timodonnell/helico)
340
+ - Previous snapshot: [`pdb-2026-04-22`](../pdb-2026-04-22) — same corpus, without contacts