timodonnell commited on
Commit
c58bf17
·
verified ·
1 Parent(s): 38e6d13

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +186 -3
README.md CHANGED
@@ -1,3 +1,186 @@
1
- ---
2
- license: cc-by-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ task_categories:
4
+ - text-generation
5
+ language:
6
+ - en
7
+ tags:
8
+ - protein-structure
9
+ - alphafold
10
+ - structural-biology
11
+ size_categories:
12
+ - 10M<n<100M
13
+ ---
14
+
15
+ # AFDB Parquet — AlphaFold Database Structures with Cluster-Based Splits
16
+
17
+ A curated subset of ~24 million [AlphaFold Database](https://alphafold.ebi.ac.uk/) (AFDB) v4 predicted protein structures, stored as sharded Parquet files. Each row contains the raw mmCIF structure text alongside metadata, precomputed cluster IDs, and leakage-resistant train/val/test split assignments.
18
+
19
+ ## Dataset Summary
20
+
21
+ | Property | Value |
22
+ |----------|-------|
23
+ | Source | [AlphaFold Database v4](https://alphafold.ebi.ac.uk/) (DeepMind / EMBL-EBI) |
24
+ | Total entries | ~24,009,002 |
25
+ | Shards | 12,005 (2,000 entries each) |
26
+ | Format | Apache Parquet, ZSTD compressed (level 12) |
27
+ | Estimated total size | ~1.2 TB |
28
+ | Splits | train (98%), val (1%), test (1%) |
29
+
30
+ ## Selection Criteria
31
+
32
+ Entries were selected from the public BigQuery table `bigquery-public-data.deepmind_alphafold.metadata` with the following filters:
33
+
34
+ | Filter | Value | Description |
35
+ |--------|-------|-------------|
36
+ | `latestVersion` | `= 4` | Only AFDB v4 structures |
37
+ | `skip_fragments` | `true` | `uniprotStart = 1` AND `uniprotEnd = LENGTH(uniprotSequence)` — only full-length UniProt models, no fragments |
38
+ | `globalMetricValue` | `>= 70.0` | Minimum global mean pLDDT of 70 |
39
+ | `LENGTH(uniprotSequence)` | `<= 2048` | Maximum sequence length of 2048 residues |
40
+
41
+ The BigQuery query scans ~178 million rows from the AFDB v4 metadata table. After applying the above filters, approximately 30 million entries are returned. These are then further filtered by cluster membership (see below), yielding the final ~24 million entries.
42
+
43
+ ### Cluster-Based Filtering
44
+
45
+ Only entries present in **both** of the following precomputed cluster files are included:
46
+
47
+ 1. **Sequence clusters (AFDB50)** — `7-AFDB50-repId_memId.tsv.gz` from [Steinegger lab AFDB cluster page](https://afdb-cluster.steineggerlab.workers.dev/) (Version 3). Groups proteins at 50% sequence identity using Foldseek.
48
+
49
+ 2. **Structural clusters** — `5-allmembers-repId-entryId-cluFlag-taxId.tsv.gz` from the same source. Only entries with `cluFlag=2` (structurally clustered) are loaded; fragments, singletons, and sequence-only entries are excluded. This file groups proteins by 3D fold similarity, which is a stricter criterion than sequence identity.
50
+
51
+ Entries missing from either cluster file are dropped entirely.
52
+
53
+ ## Leakage-Resistant Splits
54
+
55
+ Split assignment uses the **structural cluster representative** as the hash key, ensuring all proteins sharing a 3D fold land in the same split.
56
+
57
+ The algorithm:
58
+
59
+ 1. Look up the structural cluster representative ID for each entry
60
+ 2. Compute `h = SHA1("contactdoc-v1" + "::" + cluster_id)`
61
+ 3. Interpret the first 8 bytes as a uint64: `u = uint64 / 2^64` → uniform in [0, 1)
62
+ 4. Assign split:
63
+ - `train` if `u < 0.98`
64
+ - `val` if `0.98 <= u < 0.99`
65
+ - `test` if `u >= 0.99`
66
+
67
+ This is fully deterministic — the same cluster ID always maps to the same split across runs.
68
+
69
+ ## Schema
70
+
71
+ Each Parquet file contains a flat table with the following columns:
72
+
73
+ | Column | Type | Description |
74
+ |--------|------|-------------|
75
+ | `entry_id` | `string` | AFDB entry ID (e.g., `AF-A0A1C0V126-F1`) |
76
+ | `uniprot_accession` | `string` | UniProt accession (e.g., `A0A1C0V126`) |
77
+ | `tax_id` | `int64` | NCBI taxonomy ID |
78
+ | `organism_name` | `string` | Scientific name of the organism |
79
+ | `global_plddt` | `float32` | Global mean pLDDT confidence score (70–100) |
80
+ | `seq_len` | `int32` | Sequence length in residues |
81
+ | `seq_cluster_id` | `string` | AFDB50 sequence cluster representative entry ID |
82
+ | `struct_cluster_id` | `string` | Structural cluster representative entry ID |
83
+ | `split` | `string` | `train`, `val`, or `test` |
84
+ | `gcs_uri` | `string` | Original GCS URI (e.g., `gs://public-datasets-deepmind-alphafold-v4/AF-...`) |
85
+ | `cif_content` | `string` | Complete raw mmCIF file text |
86
+
87
+ ## File Structure
88
+
89
+ ```
90
+ shard_000000-009999/
91
+ shard_000000.parquet
92
+ shard_000001.parquet
93
+ ...
94
+ shard_009999.parquet
95
+ shard_010000-012004
96
+ shard_010000.parquet
97
+ shard_010001.parquet
98
+ ...
99
+ shard_012004.parquet
100
+ ```
101
+
102
+ Each shard contains up to 2,000 rows (one row per protein structure). Files are compressed with ZSTD at level 12, averaging ~100 MB per shard.
103
+
104
+ ## Usage
105
+
106
+ ### Loading with PyArrow
107
+
108
+ ```python
109
+ import pyarrow.parquet as pq
110
+
111
+ # Read a single shard
112
+ table = pq.read_table("shard_000000-009999/shard_000000.parquet")
113
+ print(table.schema)
114
+ print(f"{len(table)} rows")
115
+
116
+ # Access a specific column
117
+ entry_ids = table["entry_id"].to_pylist()
118
+ cif_texts = table["cif_content"].to_pylist()
119
+ ```
120
+
121
+ ### Loading with Pandas
122
+
123
+ ```python
124
+ import pandas as pd
125
+
126
+ df = pd.read_parquet("shard_000000-009999/shard_000000.parquet")
127
+ print(df[["entry_id", "organism_name", "global_plddt", "seq_len", "split"]].head())
128
+ ```
129
+
130
+ ### Filtering by Split
131
+
132
+ ```python
133
+ import pyarrow.parquet as pq
134
+ import pyarrow.dataset as ds
135
+
136
+ dataset = ds.dataset("./", format="parquet")
137
+ train = dataset.to_table(filter=ds.field("split") == "train")
138
+ ```
139
+
140
+ ### Parsing Structures with Gemmi
141
+
142
+ ```python
143
+ import gemmi
144
+
145
+ row = table.to_pydict()
146
+ cif_text = row["cif_content"][0]
147
+ doc = gemmi.cif.read_string(cif_text)
148
+ structure = gemmi.make_structure_from_block(doc.sole_block())
149
+ model = structure[0]
150
+ chain = model[0]
151
+ print(f"{len(chain)} residues")
152
+ ```
153
+ ## Data Source and License
154
+
155
+ - **AlphaFold Database** structures are provided by DeepMind and EMBL-EBI under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
156
+ - **Cluster files** are from the [Steinegger lab](https://afdb-cluster.steineggerlab.workers.dev/), based on Foldseek clustering of AFDB v4 (Version 3 clusters).
157
+
158
+ ### Citation
159
+
160
+ If you use this dataset, please cite the AlphaFold Database:
161
+
162
+ ```bibtex
163
+ @article{varadi2022alphafold,
164
+ title={AlphaFold Protein Structure Database: massively expanding the structural coverage of protein-sequence space with high-accuracy models},
165
+ author={Varadi, Mihaly and Anyango, Stephen and Deshpande, Mandar and others},
166
+ journal={Nucleic Acids Research},
167
+ volume={50},
168
+ number={D1},
169
+ pages={D439--D444},
170
+ year={2022},
171
+ doi={10.1093/nar/gkab1061}
172
+ }
173
+ ```
174
+
175
+ And the AFDB cluster resource:
176
+
177
+ ```bibtex
178
+ @article{barrio2024clustering,
179
+ title={Clustering predicted structures at the scale of the known protein universe},
180
+ author={Barrio-Hernandez, Inigo and Yeo, Jimin and Jänes, Jürgen and others},
181
+ journal={Nature},
182
+ volume={622},
183
+ pages={637--645},
184
+ year={2023},
185
+ doi={10.1038/s41586-023-06510-w}
186
+ }