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structures for the **6,540 sequences** in `missing_pdb_afdb_training.fasta`: the
|
| 4 |
+
training-split subset of the GPBridge expanded-GO dataset that has neither a PDB
|
| 5 |
+
entry nor an AlphaFold DB model, so it had to be predicted rather than fetched.
|
| 6 |
+
|
| 7 |
+
Sequence ids are `seq_<sha256(sequence)[:20]>`, the same convention as the rest
|
| 8 |
+
of the dataset, so a structure always maps back to its exact sequence.
|
| 9 |
+
|
| 10 |
+
> **Status: in progress.** Predictions are published per shard as they finish.
|
| 11 |
+
> `shard_index.tsv` lists all 6,540 sequences; check which archives actually
|
| 12 |
+
> exist before assuming a sequence is available.
|
| 13 |
+
|
| 14 |
+
## Layout
|
| 15 |
+
|
| 16 |
+
```
|
| 17 |
+
predictions/missing_pdb_afdb/part_00000.tar.zst 500 sequences
|
| 18 |
+
...
|
| 19 |
+
predictions/missing_pdb_afdb/part_00013.tar.zst 40 sequences
|
| 20 |
+
shard_index.tsv seq_id -> archive, length, split
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
Shards hold 500 sequences each and are **grouped by length**, not by any
|
| 24 |
+
biological property — AlphaFold 3 recompiles per length bucket, so keeping a
|
| 25 |
+
shard length-homogeneous amortises compilation. The consequence is that a part
|
| 26 |
+
number tells you nothing except size, which is what `shard_index.tsv` is for.
|
| 27 |
+
|
| 28 |
+
Files are bundled per shard rather than stored loose: 6,540 predictions is
|
| 29 |
+
~46,000 files, and a repo of loose objects at that scale is unusable.
|
| 30 |
+
|
| 31 |
+
## Get the structure for a sequence
|
| 32 |
+
|
| 33 |
+
```python
|
| 34 |
+
import csv, io, json, tarfile, zstandard
|
| 35 |
+
from huggingface_hub import hf_hub_download
|
| 36 |
+
|
| 37 |
+
REPO = "tonynzh2/afdb"
|
| 38 |
+
|
| 39 |
+
idx = {r["seq_id"]: r["archive"] for r in
|
| 40 |
+
csv.DictReader(open(hf_hub_download(REPO, "predictions/missing_pdb_afdb/shard_index.tsv",
|
| 41 |
+
repo_type="dataset")), delimiter="\t")}
|
| 42 |
+
|
| 43 |
+
def get(seq_ids):
|
| 44 |
+
"""Yields (seq_id, cif_text, summary_dict). Groups by archive so each is read once."""
|
| 45 |
+
by_archive = {}
|
| 46 |
+
for s in seq_ids:
|
| 47 |
+
by_archive.setdefault(idx[s], set()).add(s)
|
| 48 |
+
for archive, wanted in by_archive.items():
|
| 49 |
+
path = hf_hub_download(REPO, archive, repo_type="dataset")
|
| 50 |
+
cif, summary = {}, {}
|
| 51 |
+
with open(path, "rb") as fh:
|
| 52 |
+
stream = zstandard.ZstdDecompressor().stream_reader(fh)
|
| 53 |
+
with tarfile.open(fileobj=stream, mode="r|") as tar: # streaming, low memory
|
| 54 |
+
for m in tar:
|
| 55 |
+
if not m.isfile() or "/seed-" in m.name:
|
| 56 |
+
continue
|
| 57 |
+
sid = m.name.split("/")[0]
|
| 58 |
+
if sid not in wanted:
|
| 59 |
+
continue
|
| 60 |
+
if m.name.endswith("_model.cif"):
|
| 61 |
+
cif[sid] = tar.extractfile(m).read().decode()
|
| 62 |
+
elif m.name.endswith("_summary_confidences.json"):
|
| 63 |
+
summary[sid] = json.load(tar.extractfile(m))
|
| 64 |
+
for sid in cif:
|
| 65 |
+
yield sid, cif[sid], summary.get(sid, {})
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
Whole archive from the shell:
|
| 69 |
+
|
| 70 |
+
```bash
|
| 71 |
+
hf download tonynzh2/afdb predictions/missing_pdb_afdb/part_00000.tar.zst \
|
| 72 |
+
--repo-type=dataset --local-dir .
|
| 73 |
+
zstd -dc part_00000.tar.zst | tar -xf - # GNU tar <1.31 has no --zstd
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
## What is in each prediction
|
| 77 |
+
|
| 78 |
+
```
|
| 79 |
+
seq_<id>/
|
| 80 |
+
├── seq_<id>_model.cif top-ranked structure <- use this
|
| 81 |
+
├── seq_<id>_summary_confidences.json ptm, ranking_score, has_clash, ...
|
| 82 |
+
├── seq_<id>_confidences.json per-atom pLDDT, PAE matrix
|
| 83 |
+
├── seq_<id>_data.json the MSAs and templates used as input
|
| 84 |
+
├── seq_<id>_ranking_scores.csv score per diffusion sample
|
| 85 |
+
├── seed-20260916_sample-{0..4}/ all 5 samples, each with its own cif
|
| 86 |
+
└── TERMS_OF_USE.md
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
`_data.json` is most of the bytes — it embeds a 50,000-row UniProt MSA. Drop it
|
| 90 |
+
unless you need to reproduce or re-run the input. Per-residue pLDDT is in the
|
| 91 |
+
B-factor column of the mmCIF.
|
| 92 |
+
|
| 93 |
+
## Filter on confidence
|
| 94 |
+
|
| 95 |
+
These are predictions, not experimental structures, and the spread is wide:
|
| 96 |
+
in spot checks `ptm` ranged 0.19 to 0.85 within a single shard, tracking MSA
|
| 97 |
+
depth. From `*_summary_confidences.json`:
|
| 98 |
+
|
| 99 |
+
| field | use |
|
| 100 |
+
|---|---|
|
| 101 |
+
| `ranking_score` | AlphaFold 3's own overall ranking — the primary filter |
|
| 102 |
+
| `ptm` | fold-level confidence |
|
| 103 |
+
| `has_clash` | drop anything non-zero |
|
| 104 |
+
| `fraction_disordered` | high values mean much of the chain is unstructured |
|
| 105 |
+
|
| 106 |
+
Look at the distribution before choosing a cutoff rather than inheriting one.
|
| 107 |
+
On one measured shard, `ranking_score >= 0.7` with no clash kept 97%, and
|
| 108 |
+
`>= 0.8` kept 74%.
|
| 109 |
+
|
| 110 |
+
## Protocol
|
| 111 |
+
|
| 112 |
+
Stock open-source AlphaFold 3, defaults throughout — no protocol deviations.
|
| 113 |
+
|
| 114 |
+
| Setting | Value |
|
| 115 |
+
|---|---|
|
| 116 |
+
| Code | google-deepmind/alphafold3 v3.0.4 (`c0f97ed`) |
|
| 117 |
+
| Genetic search | full standard pipeline: UniRef90, MGnify, small BFD, UniProt |
|
| 118 |
+
| Templates | searched (PDB seqres + mmCIF, `max_template_date` 2021-09-30) |
|
| 119 |
+
| Diffusion samples | 5 (default) |
|
| 120 |
+
| Recycles | 10 (default) |
|
| 121 |
+
| Model seed | 20260916 |
|
| 122 |
+
| Databases | the versions used in the AlphaFold 3 paper |
|
| 123 |
+
|
| 124 |
+
Both MSAs AlphaFold 3 builds are kept — unpaired and paired (UniProt). The
|
| 125 |
+
paired MSA is retained even though every input is a single chain, because
|
| 126 |
+
AlphaFold 3 featurises it as `msa_all_seq` regardless of chain count and its
|
| 127 |
+
presence also changes the unpaired crop size; omitting it would not be the
|
| 128 |
+
standard protocol.
|
| 129 |
+
|
| 130 |
+
## Related
|
| 131 |
+
|
| 132 |
+
- `gpbridge/join.tsv.gz` — ties every structure in this repo back to a dataset
|
| 133 |
+
sequence. Nothing in the filenames does.
|
| 134 |
+
- `gpbridge/afdb/`, `gpbridge/pdb/` — the fetched AlphaFold DB and PDB
|
| 135 |
+
structures for the rest of the dataset.
|
| 136 |
+
- `gpbridge/afdb_no_model_needs_af3.fasta` — 1,508 sequences the source bundle
|
| 137 |
+
counted as having an AlphaFold DB model that in fact has none. They are not in
|
| 138 |
+
`missing_pdb_afdb_training.fasta` either, so they also need prediction.
|
| 139 |
+
|
| 140 |
+
## Terms of use
|
| 141 |
+
|
| 142 |
+
These are AlphaFold 3 Output, subject to the
|
| 143 |
+
[AlphaFold 3 Output Terms of Use](../../OUTPUT_TERMS_OF_USE.md) — non-commercial
|
| 144 |
+
use, and redistribution must carry the terms. Each archive also contains
|
| 145 |
+
AlphaFold 3's own `TERMS_OF_USE.md`.
|
| 146 |
+
|
| 147 |
+
Cite: Abramson, J. et al. Accurate structure prediction of biomolecular
|
| 148 |
+
interactions with AlphaFold 3. *Nature* **630**, 493–500 (2024).
|
predictions/missing_pdb_afdb/shard_index.tsv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|