OpenProteinSet / README.md
anindya64's picture
Update README.md
51c68d3 verified
metadata
license: other
pretty_name: OpenProteinSet Archive
size_categories:
  - 100K<n<1M
task_categories:
  - feature-extraction
  - other
tags:
  - biology
  - protein
  - msa
  - openfold
  - openproteinset
  - pdb
  - archive
configs:
  - config_name: files
    default: true
    data_files:
      - split: train
        path: metadata.csv
  - config_name: shards
    data_files:
      - split: train
        path: shards.csv
  - config_name: parts
    data_files:
      - split: train
        path: parts.csv

OpenProteinSet

OpenProteinSet is an open-source corpus released by the OpenFold team (Ahdritz et al., NeurIPS 2023 Datasets and Benchmarks) that reproduces and extends the kind of training data used for AlphaFold2, which DeepMind never released. It contains more than 16 million precomputed multiple sequence alignments (MSAs), structural template hits from the Protein Data Bank, and AlphaFold2 structure predictions, and was used to train OpenFold from scratch to parity with AlphaFold2. The corpus has two main components. The first is a faithful, updated reconstruction of AlphaFold2's PDB-side training set: MSAs and HHSearch template hits for every unique PDB chain, generated with the same pipeline (JackHMMER against UniRef90 and MGnify, HHBlits against BFD+Uniclust30, HHSearch against PDB70). The second is a Uniclust30-side set: one MSA per Uniclust30 cluster representative, totaling roughly 16M MSAs, from which a maximally diverse and deep subset is identified and paired with AlphaFold2 self-distillation predictions suitable for AlphaFold2-style noisy student training.

What Is Included

Component Files Size
alignment_data/ 524,454 600.05 GiB
pdb_data/ 3 52.22 GiB
duplicate_pdb_chains.txt 1 4.31 MiB

File types:

Type Files Size
.a3m 393,000 535.65 GiB
.hhr 131,454 64.40 GiB
.zip 1 51.77 GiB
.json 2 456.83 MiB
.txt 1 4.31 MiB

Packaging summary:

Item Count / Size
Original files 524,458
Original payload 652.27 GiB
Tar shards 31
Split large-file parts 3
Archived tar payload 601.38 GiB
Metadata generated 2026-05-24T22:58:05Z

Repository Layout

README.md
_MANIFEST.json
metadata.csv
shards.csv
parts.csv
shards/
  shard-00000.tar
  shard-00001.tar
  ...
large_files/
  pdb_data/pdb_mmcif.zip.part-00000
  pdb_data/pdb_mmcif.zip.part-00001
  pdb_data/pdb_mmcif.zip.part-00002

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.

Metadata Tables

metadata.csv is the default table shown in the Dataset Viewer. It has one row per original file.

Column Meaning
path Original relative path in the OpenProteinSet tree.
storage_type tar for files inside shards/*.tar, parts for files split into byte parts.
shard_path Tar shard to download when storage_type == "tar".
member_path Path of the file inside the tar shard.
parts_count Number of parts when storage_type == "parts".
part_paths Semicolon-separated part paths for split files.
top_level, directory, filename, extension Path fields for filtering.
size_bytes, size_human, modified_utc File size and timestamp captured during packaging.

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.

Install

Use recent versions of the Hugging Face clients:

# pip install -U huggingface_hub datasets

All examples below use Python APIs only.

Inspect The File List

Load the metadata table with datasets:

from datasets import load_dataset

repo_id = "LiteFold/OpenProteinSet-archive"
files = load_dataset(repo_id, "files", split="train")

print(files)
print(files[0])

For quick inspection without materializing the whole table:

from datasets import load_dataset

repo_id = "LiteFold/OpenProteinSet-archive"
files = load_dataset(repo_id, "files", split="train", streaming=True)

for row in files:
    if row["extension"] == ".a3m":
        print(row["path"], row["shard_path"], row["size_human"])
        break

Download One File From A Tar Shard

This downloads the shard that contains the file, then extracts only that member.

from pathlib import Path
import tarfile

from datasets import load_dataset
from huggingface_hub import hf_hub_download

repo_id = "LiteFold/OpenProteinSet-archive"
out_dir = Path("./openproteinset")

files = load_dataset(repo_id, "files", split="train", streaming=True)
row = next(item for item in files if item["extension"] == ".a3m")

if row["storage_type"] != "tar":
    raise ValueError(f"{row['path']} is not stored in a tar shard")

shard = hf_hub_download(
    repo_id=repo_id,
    repo_type="dataset",
    filename=row["shard_path"],
)

with tarfile.open(shard) as archive:
    archive.extract(row["member_path"], path=out_dir)

print(out_dir / row["path"])

Reassemble pdb_mmcif.zip

pdb_data/pdb_mmcif.zip is split into three parts. Reassemble it with the paths listed in metadata.csv:

from pathlib import Path

from datasets import load_dataset
from huggingface_hub import hf_hub_download

repo_id = "LiteFold/OpenProteinSet-archive"
out_path = Path("./openproteinset/pdb_data/pdb_mmcif.zip")
out_path.parent.mkdir(parents=True, exist_ok=True)

files = load_dataset(repo_id, "files", split="train")
row = files.filter(lambda item: item["path"] == "pdb_data/pdb_mmcif.zip")[0]

with out_path.open("wb") as dst:
    for part_path in row["part_paths"].split(";"):
        part = hf_hub_download(
            repo_id=repo_id,
            repo_type="dataset",
            filename=part_path,
        )
        with Path(part).open("rb") as src:
            while chunk := src.read(8 * 1024 * 1024):
                dst.write(chunk)

print(out_path)

Download And Restore Everything

This pulls the full repository snapshot, extracts all tar shards, and reassembles any split large files.

from pathlib import Path
import csv
import tarfile

from huggingface_hub import snapshot_download

repo_id = "LiteFold/OpenProteinSet-archive"
snapshot = Path(snapshot_download(repo_id=repo_id, repo_type="dataset"))
out_dir = Path("./openproteinset")
out_dir.mkdir(parents=True, exist_ok=True)

for shard in sorted((snapshot / "shards").glob("*.tar")):
    with tarfile.open(shard) as archive:
        archive.extractall(out_dir)

with (snapshot / "metadata.csv").open(newline="") as handle:
    for row in csv.DictReader(handle):
        if row["storage_type"] != "parts":
            continue

        target = out_dir / row["path"]
        target.parent.mkdir(parents=True, exist_ok=True)
        with target.open("wb") as dst:
            for part_path in row["part_paths"].split(";"):
                with (snapshot / part_path).open("rb") as src:
                    while chunk := src.read(8 * 1024 * 1024):
                        dst.write(chunk)

print(out_dir)

Citation

@inproceedings{ahdritz2023openproteinset,
  title     = {OpenProteinSet: Training Data for Structural Biology at Scale},
  author    = {Ahdritz, Gustaf and Bouatta, Nazim and Kadyan, Sachin and Jarosch, Lukas and Berenberg, Daniel and Fisk, Ian and Watkins, Andrew M. and Ra, Stephen and Bonneau, Richard and AlQuraishi, Mohammed},
  booktitle = {Advances in Neural Information Processing Systems 36: Datasets and Benchmarks Track},
  year      = {2023},
  url       = {https://openreview.net/forum?id=gO0kS0eE0F},
  eprint    = {2308.05326},
  archivePrefix = {arXiv},
  primaryClass  = {q-bio.BM}
}