anindya64 commited on
Commit
629d5d5
·
verified ·
1 Parent(s): f51a864

Improve dataset card

Browse files
Files changed (1) hide show
  1. README.md +188 -155
README.md CHANGED
@@ -1,16 +1,19 @@
1
  ---
2
- pretty_name: OpenProteinSet
 
3
  size_categories:
4
  - 100K<n<1M
5
  task_categories:
6
- - other
 
7
  tags:
8
  - biology
9
  - protein
10
- - rna
11
- - structure-prediction
12
- - tar
13
- - datasets
 
14
  configs:
15
  - config_name: files
16
  default: true
@@ -27,188 +30,218 @@ configs:
27
  path: parts.csv
28
  ---
29
 
30
- # OpenProteinSet
31
 
32
- This dataset preserves the source folder as tar shards plus split part files for any source file larger than one shard. `metadata.csv` has one row per original file and is configured as the default Dataset Viewer table.
33
 
34
- ## Summary
35
 
36
- | | |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  |---|---:|
38
  | Original files | 524,458 |
39
- | Original payload | 652.27 GiB (700,373,228,509 bytes) |
40
  | Tar shards | 31 |
41
- | Large-file parts | 3 |
42
- | Archive size | 601.38 GiB (645,729,484,800 bytes) |
43
- | Max shard payload | 20.00 GiB |
44
- | Max large-file part | 20.00 GiB |
45
  | Metadata generated | 2026-05-24T22:58:05Z |
46
 
47
- ## Source Layout
48
-
49
- | Directory | Files | Size |
50
- | --- | --- | --- |
51
- | . | 1 | 4.31 MiB |
52
- | alignment_data | 524,454 | 600.05 GiB |
53
- | pdb_data | 3 | 52.22 GiB |
54
-
55
- ## Common File Types
56
-
57
- | Extension | Files | Size |
58
- | --- | --- | --- |
59
- | .a3m | 393,000 | 535.65 GiB |
60
- | .hhr | 131,454 | 64.40 GiB |
61
- | .zip | 1 | 51.77 GiB |
62
- | .json | 2 | 456.83 MiB |
63
- | .txt | 1 | 4.31 MiB |
64
-
65
- ## Shards
66
-
67
- | Shard | Files | Payload | Archive |
68
- | --- | --- | --- | --- |
69
- | shards/shard-00000.tar | 19,802 | 20.00 GiB | 20.03 GiB |
70
- | shards/shard-00001.tar | 19,903 | 20.00 GiB | 20.03 GiB |
71
- | shards/shard-00002.tar | 20,041 | 20.00 GiB | 20.03 GiB |
72
- | shards/shard-00003.tar | 20,140 | 20.00 GiB | 20.03 GiB |
73
- | shards/shard-00004.tar | 20,709 | 20.00 GiB | 20.03 GiB |
74
- | shards/shard-00005.tar | 28,209 | 20.00 GiB | 20.05 GiB |
75
- | shards/shard-00006.tar | 19,067 | 20.00 GiB | 20.03 GiB |
76
- | shards/shard-00007.tar | 16,872 | 20.00 GiB | 20.03 GiB |
77
- | shards/shard-00008.tar | 17,166 | 20.00 GiB | 20.03 GiB |
78
- | shards/shard-00009.tar | 17,521 | 20.00 GiB | 20.03 GiB |
79
- | shards/shard-00010.tar | 16,548 | 20.00 GiB | 20.03 GiB |
80
- | shards/shard-00011.tar | 16,286 | 20.00 GiB | 20.03 GiB |
81
- | shards/shard-00012.tar | 16,155 | 20.00 GiB | 20.03 GiB |
82
- | shards/shard-00013.tar | 16,390 | 20.00 GiB | 20.03 GiB |
83
- | shards/shard-00014.tar | 16,995 | 20.00 GiB | 20.02 GiB |
84
- | shards/shard-00015.tar | 16,318 | 19.99 GiB | 20.02 GiB |
85
- | shards/shard-00016.tar | 18,167 | 20.00 GiB | 20.03 GiB |
86
- | shards/shard-00017.tar | 16,870 | 20.00 GiB | 20.03 GiB |
87
- | shards/shard-00018.tar | 15,837 | 20.00 GiB | 20.02 GiB |
88
- | shards/shard-00019.tar | 16,787 | 20.00 GiB | 20.03 GiB |
89
- | shards/shard-00020.tar | 16,173 | 20.00 GiB | 20.03 GiB |
90
- | shards/shard-00021.tar | 16,894 | 20.00 GiB | 20.03 GiB |
91
- | shards/shard-00022.tar | 16,107 | 20.00 GiB | 20.02 GiB |
92
- | shards/shard-00023.tar | 16,371 | 20.00 GiB | 20.03 GiB |
93
- | shards/shard-00024.tar | 15,837 | 20.00 GiB | 20.02 GiB |
94
-
95
- Only the first 25 shards are shown here. See `shards.csv` for all 31 shards.
96
-
97
- ## Metadata
98
-
99
- `metadata.csv` columns:
100
-
101
- | Column | Description |
102
  |---|---|
103
- | `path` | Original relative path in the source folder. |
104
- | `storage_type` | `tar` for files inside tar shards, or `parts` for oversized files split into byte parts. |
105
- | `shard_path` | Tar shard containing the file when `storage_type` is `tar`. |
106
  | `member_path` | Path of the file inside the tar shard. |
107
- | `parts_count` | Number of part files when `storage_type` is `parts`. |
108
- | `part_paths` | Semicolon-separated part paths when `storage_type` is `parts`. |
109
- | `top_level` | First directory under the source folder. |
110
- | `directory` | Parent directory of the file. |
111
- | `filename` | File basename. |
112
- | `extension` | File extension, preserving compound suffixes such as `.csv.gz`. |
113
- | `size_bytes` | Original file size in bytes. |
114
- | `size_human` | Human-readable original file size. |
115
- | `modified_utc` | Local file modification timestamp captured during packaging. |
116
-
117
- `shards.csv` lists one row per tar shard. `parts.csv` lists one row per split large-file part. `_MANIFEST.json` contains the aggregate build summary.
118
-
119
- ## Download Everything
120
-
121
- ```bash
122
- pip install -U huggingface_hub
123
- hf download LiteFold/OpenProteinSet-archive --repo-type dataset --local-dir ./OpenProteinSet-archive
124
  ```
125
 
126
- Extract all shards:
 
 
 
 
127
 
128
- ```bash
129
- mkdir -p ./data
130
- for shard in ./OpenProteinSet-archive/shards/*.tar; do
131
- tar -xf "$shard" -C ./data
132
- done
 
 
 
133
  ```
134
 
135
- Reassemble any split large files:
136
 
137
- ```bash
138
- python - <<'PY'
139
- import csv
140
- from pathlib import Path
141
 
142
- root = Path("./OpenProteinSet-archive")
143
- out = Path("./data")
144
- with (root / "metadata.csv").open(newline="") as handle:
145
- for row in csv.DictReader(handle):
146
- if row["storage_type"] != "parts":
147
- continue
148
- target = out / row["path"]
149
- target.parent.mkdir(parents=True, exist_ok=True)
150
- with target.open("wb") as dst:
151
- for part in row["part_paths"].split(";"):
152
- with (root / part).open("rb") as src:
153
- while True:
154
- chunk = src.read(8 * 1024 * 1024)
155
- if not chunk:
156
- break
157
- dst.write(chunk)
158
- PY
159
  ```
160
 
161
- ## Use With `datasets`
162
 
163
- Use the `datasets` API to query file metadata, then use `huggingface_hub` to download the shard that contains the file.
164
 
165
  ```python
 
 
 
166
  from datasets import load_dataset
167
  from huggingface_hub import hf_hub_download
168
- import tarfile
169
 
170
- files = load_dataset("LiteFold/OpenProteinSet-archive", "files", split="train")
171
- row = files[0]
172
 
173
- if row["storage_type"] == "tar":
174
- shard = hf_hub_download(
175
- repo_id="LiteFold/OpenProteinSet-archive",
176
- repo_type="dataset",
177
- filename=row["shard_path"],
178
- )
179
- with tarfile.open(shard) as archive:
180
- archive.extract(row["member_path"], path="./data")
181
- else:
182
- from pathlib import Path
183
-
184
- target = Path("./data") / row["path"]
185
- target.parent.mkdir(parents=True, exist_ok=True)
186
- with target.open("wb") as dst:
187
- for part_path in row["part_paths"].split(";"):
188
- part = hf_hub_download(
189
- repo_id="LiteFold/OpenProteinSet-archive",
190
- repo_type="dataset",
191
- filename=part_path,
192
- )
193
- with Path(part).open("rb") as src:
194
- while True:
195
- chunk = src.read(8 * 1024 * 1024)
196
- if not chunk:
197
- break
198
- dst.write(chunk)
199
  ```
200
 
201
- For streaming metadata:
 
 
202
 
203
  ```python
 
 
204
  from datasets import load_dataset
 
205
 
206
- files = load_dataset("LiteFold/OpenProteinSet-archive", "files", split="train", streaming=True)
207
- for row in files:
208
- print(row["path"], row["shard_path"])
209
- break
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  ```
211
 
212
  ## Notes
213
 
214
- The tar shards are uncompressed by design. This keeps packaging and random extraction simple and avoids spending CPU compressing data that is often already compressed.
 
 
 
 
1
  ---
2
+ license: other
3
+ pretty_name: OpenProteinSet Archive
4
  size_categories:
5
  - 100K<n<1M
6
  task_categories:
7
+ - protein-folding
8
+ - feature-extraction
9
  tags:
10
  - biology
11
  - protein
12
+ - msa
13
+ - openfold
14
+ - openproteinset
15
+ - pdb
16
+ - archive
17
  configs:
18
  - config_name: files
19
  default: true
 
30
  path: parts.csv
31
  ---
32
 
33
+ # OpenProteinSet Archive
34
 
35
+ This is an upload-friendly mirror of OpenProteinSet/OpenFold training data components. The source tree is kept intact inside archive shards rather than expanded as hundreds of thousands of repository files.
36
 
37
+ The main use case is simple: search `metadata.csv`, download the shard or part files you need with the Hugging Face Python API, then extract or reassemble the original file.
38
 
39
+ ## What Is Included
40
+
41
+ | Component | Files | Size |
42
+ |---|---:|---:|
43
+ | `alignment_data/` | 524,454 | 600.05 GiB |
44
+ | `pdb_data/` | 3 | 52.22 GiB |
45
+ | `duplicate_pdb_chains.txt` | 1 | 4.31 MiB |
46
+
47
+ File types:
48
+
49
+ | Type | Files | Size |
50
+ |---|---:|---:|
51
+ | `.a3m` | 393,000 | 535.65 GiB |
52
+ | `.hhr` | 131,454 | 64.40 GiB |
53
+ | `.zip` | 1 | 51.77 GiB |
54
+ | `.json` | 2 | 456.83 MiB |
55
+ | `.txt` | 1 | 4.31 MiB |
56
+
57
+ Packaging summary:
58
+
59
+ | Item | Count / Size |
60
  |---|---:|
61
  | Original files | 524,458 |
62
+ | Original payload | 652.27 GiB |
63
  | Tar shards | 31 |
64
+ | Split large-file parts | 3 |
65
+ | Archived tar payload | 601.38 GiB |
 
 
66
  | Metadata generated | 2026-05-24T22:58:05Z |
67
 
68
+ ## Repository Layout
69
+
70
+ ```text
71
+ README.md
72
+ _MANIFEST.json
73
+ metadata.csv
74
+ shards.csv
75
+ parts.csv
76
+ shards/
77
+ shard-00000.tar
78
+ shard-00001.tar
79
+ ...
80
+ large_files/
81
+ pdb_data/pdb_mmcif.zip.part-00000
82
+ pdb_data/pdb_mmcif.zip.part-00001
83
+ pdb_data/pdb_mmcif.zip.part-00002
84
+ ```
85
+
86
+ Most files live inside `shards/*.tar`. The large `pdb_data/pdb_mmcif.zip` file is stored as byte parts under `large_files/` so no single uploaded object is excessively large.
87
+
88
+ ## Metadata Tables
89
+
90
+ `metadata.csv` is the default table shown in the Dataset Viewer. It has one row per original file.
91
+
92
+ | Column | Meaning |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  |---|---|
94
+ | `path` | Original relative path in the OpenProteinSet tree. |
95
+ | `storage_type` | `tar` for files inside `shards/*.tar`, `parts` for files split into byte parts. |
96
+ | `shard_path` | Tar shard to download when `storage_type == "tar"`. |
97
  | `member_path` | Path of the file inside the tar shard. |
98
+ | `parts_count` | Number of parts when `storage_type == "parts"`. |
99
+ | `part_paths` | Semicolon-separated part paths for split files. |
100
+ | `top_level`, `directory`, `filename`, `extension` | Path fields for filtering. |
101
+ | `size_bytes`, `size_human`, `modified_utc` | File size and timestamp captured during packaging. |
102
+
103
+ `shards.csv` has one row per tar shard. `parts.csv` has one row per split file part. `_MANIFEST.json` contains the packaging summary used to build this card.
104
+
105
+ ## Install
106
+
107
+ Use recent versions of the Hugging Face clients:
108
+
109
+ ```python
110
+ # pip install -U huggingface_hub datasets
 
 
 
 
111
  ```
112
 
113
+ All examples below use Python APIs only.
114
+
115
+ ## Inspect The File List
116
+
117
+ Load the metadata table with `datasets`:
118
 
119
+ ```python
120
+ from datasets import load_dataset
121
+
122
+ repo_id = "LiteFold/OpenProteinSet-archive"
123
+ files = load_dataset(repo_id, "files", split="train")
124
+
125
+ print(files)
126
+ print(files[0])
127
  ```
128
 
129
+ For quick inspection without materializing the whole table:
130
 
131
+ ```python
132
+ from datasets import load_dataset
 
 
133
 
134
+ repo_id = "LiteFold/OpenProteinSet-archive"
135
+ files = load_dataset(repo_id, "files", split="train", streaming=True)
136
+
137
+ for row in files:
138
+ if row["extension"] == ".a3m":
139
+ print(row["path"], row["shard_path"], row["size_human"])
140
+ break
 
 
 
 
 
 
 
 
 
 
141
  ```
142
 
143
+ ## Download One File From A Tar Shard
144
 
145
+ This downloads the shard that contains the file, then extracts only that member.
146
 
147
  ```python
148
+ from pathlib import Path
149
+ import tarfile
150
+
151
  from datasets import load_dataset
152
  from huggingface_hub import hf_hub_download
 
153
 
154
+ repo_id = "LiteFold/OpenProteinSet-archive"
155
+ out_dir = Path("./openproteinset")
156
 
157
+ files = load_dataset(repo_id, "files", split="train", streaming=True)
158
+ row = next(item for item in files if item["extension"] == ".a3m")
159
+
160
+ if row["storage_type"] != "tar":
161
+ raise ValueError(f"{row['path']} is not stored in a tar shard")
162
+
163
+ shard = hf_hub_download(
164
+ repo_id=repo_id,
165
+ repo_type="dataset",
166
+ filename=row["shard_path"],
167
+ )
168
+
169
+ with tarfile.open(shard) as archive:
170
+ archive.extract(row["member_path"], path=out_dir)
171
+
172
+ print(out_dir / row["path"])
 
 
 
 
 
 
 
 
 
 
173
  ```
174
 
175
+ ## Reassemble `pdb_mmcif.zip`
176
+
177
+ `pdb_data/pdb_mmcif.zip` is split into three parts. Reassemble it with the paths listed in `metadata.csv`:
178
 
179
  ```python
180
+ from pathlib import Path
181
+
182
  from datasets import load_dataset
183
+ from huggingface_hub import hf_hub_download
184
 
185
+ repo_id = "LiteFold/OpenProteinSet-archive"
186
+ out_path = Path("./openproteinset/pdb_data/pdb_mmcif.zip")
187
+ out_path.parent.mkdir(parents=True, exist_ok=True)
188
+
189
+ files = load_dataset(repo_id, "files", split="train")
190
+ row = files.filter(lambda item: item["path"] == "pdb_data/pdb_mmcif.zip")[0]
191
+
192
+ with out_path.open("wb") as dst:
193
+ for part_path in row["part_paths"].split(";"):
194
+ part = hf_hub_download(
195
+ repo_id=repo_id,
196
+ repo_type="dataset",
197
+ filename=part_path,
198
+ )
199
+ with Path(part).open("rb") as src:
200
+ while chunk := src.read(8 * 1024 * 1024):
201
+ dst.write(chunk)
202
+
203
+ print(out_path)
204
+ ```
205
+
206
+ ## Download And Restore Everything
207
+
208
+ This pulls the full repository snapshot, extracts all tar shards, and reassembles any split large files.
209
+
210
+ ```python
211
+ from pathlib import Path
212
+ import csv
213
+ import tarfile
214
+
215
+ from huggingface_hub import snapshot_download
216
+
217
+ repo_id = "LiteFold/OpenProteinSet-archive"
218
+ snapshot = Path(snapshot_download(repo_id=repo_id, repo_type="dataset"))
219
+ out_dir = Path("./openproteinset")
220
+ out_dir.mkdir(parents=True, exist_ok=True)
221
+
222
+ for shard in sorted((snapshot / "shards").glob("*.tar")):
223
+ with tarfile.open(shard) as archive:
224
+ archive.extractall(out_dir)
225
+
226
+ with (snapshot / "metadata.csv").open(newline="") as handle:
227
+ for row in csv.DictReader(handle):
228
+ if row["storage_type"] != "parts":
229
+ continue
230
+
231
+ target = out_dir / row["path"]
232
+ target.parent.mkdir(parents=True, exist_ok=True)
233
+ with target.open("wb") as dst:
234
+ for part_path in row["part_paths"].split(";"):
235
+ with (snapshot / part_path).open("rb") as src:
236
+ while chunk := src.read(8 * 1024 * 1024):
237
+ dst.write(chunk)
238
+
239
+ print(out_dir)
240
  ```
241
 
242
  ## Notes
243
 
244
+ - This is a raw mirror, not a cleaned or reformatted training set.
245
+ - The alignment tree is preserved under its original relative paths inside the tar shards.
246
+ - Tar shards are uncompressed. The goal is predictable extraction and straightforward random access to individual members.
247
+ - Check the upstream OpenProteinSet/OpenFold data terms and cite the original resources as appropriate for your use case.