Skip to main content

ProteinGym Base

codecov CI pipeline

ProteinGym has become a widely used resource for comparing the ability of models to predict the effects of protein mutations. ProteinGym Base is an effort to bring more structure to the datasets so that they become easier to work with and to distribute; and to the models in the benchmark so that they become easier to install and run. Less undocumented csv's and more formal schemas. Fewer scripts with hardcoded paths and more Dockerfiles and precise requirements.

Project Structure

├── docs                       <-- Documentation, published with mkdocs
│   ├── decisions/             <-- Architecture decision records
│   ├── notebooks/             <-- Tutorial notebooks (executed in CI)
│   └── *.md                   <-- Other documentation files
├── example_data/              <-- Example data folder
│   ├── NEIME_2019/            <-- NEIME 2019 dataset
│   └── neime_2019.toml        <-- NEIME 2019 manifest file
├── src/                       <-- Source code folder
│   └── proteingym/            <-- Namespace package
│       └── base/              <-- Package
├── tests/                     <-- Test folder
│   └── test_*.py              <-- Test files
├── .adr-dir                   <-- Architecture decision records folder
├── .gitignore                 <-- Git ignore file
├── .pre-commit-config.yaml    <-- Pre-commit configuration file
├── .python-version            <-- Python version file
├── AGENTS.md                  <-- Guide for coding agents
├── CONTRIBUTING.md            <-- Contribution guide
├── mkdocs.yml                 <-- Documentation site configuration
├── pyproject.toml             <-- Project configuration file
├── README.md                  <-- This README file
└── uv.lock                    <-- Dependency lock file

Dataset Manifest

The dataset manifest is a configuration file that describes the dataset metadata and assets:

  • Assays
  • Structures
  • Sequences
  • MSAs (Multiple Sequence Alignments)

The full schema of the manifest is described in the schema. Below example code uses the NEIME 2019 dataset.

Installation

To install the package, you can use pip:

$ pip install git+https://github.com/ProteinGym/proteingym-base.git

Quickstart example

Below is a quickstart example of how to use this package.

Load data

You can load the data using a manifest file. In the example code below we load the NEIME 2019 dataset manifest:

>>> from proteingym.base import Dataset, Manifest
>>> manifest = Manifest.from_path("example_data/neime_2019.toml")
>>> manifest.name
'NEIME_2019'
>>> dataset = Dataset.from_manifest(manifest)
>>> len(dataset.assays) > 0 and len(dataset.structures) > 0
True

This will gather data from the locations specified in the manifest into a single Dataset object. Go ahead with using its data for model training or prediction.

Archive data

You can persist data in a Protein Gym archive for easy sharing and reloading.

>>> archive_path = dataset.dump(path="example_data/")
>>> archive_path.is_file() and archive_path.stat().st_size > 0  # The archive contains the dataset
True

Load archived data

You can quickly load the archived data:

>>> persisted_dataset = Dataset.from_path(archive_path)
>>> persisted_dataset.name
'NEIME_2019'
>>> archive_path.unlink()  # (FOR TESTING PURPOSES ONLY: remove the archive file for cleanup)

Access proteingym data

The Dataset object provides access to the proteingym data:

  • Assays
  • Sequences
  • Structures
  • MSAs (Multiple Sequence Alignments)

Multiple Sequence Alignment (MSA)

When loading MSA data, add the following section in the toml:

[[ msas ]]
path = "./NEIME_2019/MSA/msa.a3m"
format = "a3m"

Paths are relative to the manifest file.

To get the MSA as MultipleSeqAlignment object:

>>> from proteingym.base import Manifest, Dataset
>>> mf = Manifest.from_path("example_data/neime_2019.toml")
>>> dataset = Dataset.from_manifest(mf)
>>> isinstance(dataset.msas[0].value, list)  # The first MSA in the dataset
True

Splits

Data splits are stored as Subsets: a dataset plus named splits, each made of folds. Splitters in proteingym.base.splits create them:

>>> from proteingym.base import Subsets
>>> from proteingym.base.splits import RandomSplitter
>>> subsets = Subsets(dataset=dataset)
>>> subsets.update(random=RandomSplitter(fractions=[0.8, 0.1, 0.1]).split(dataset=dataset))
>>> list(subsets.slices)
['random']

Subsets.dump writes a .splits.pgdata archive and Subsets.from_path loads it. See the splitting tutorial and the dataset archive docs.

Metrics

proteingym.base.metrics scores model predictions against a dataset or splits (Spearman, top-k recovery, ...). See metrics.

Command line

The package installs a proteingym-base CLI (run any command with --help):

Command Purpose
build Build a dataset archive from a manifest.
list-datasets List the .pgdata archives in a folder as JSON.
list-models List the model cards in a folder as JSON.
validate Validate a model project (its pyproject.toml entry points and model card)
generate-data Generate dummy data for testing.
evaluate-subset Score predictions on cross-validation splits and write JSON.
evaluate-dataset Score predictions on a plain dataset and write JSON.
evaluate-zero-shot Score zero-shot predictions against the full dataset and write JSON.

Model cards

proteingym.base.model.ModelCard reads a model card: a README.md whose YAML front matter holds the model name, hyper_parameters and any extra fields. Model cards are used by the ProteinGym benchmark.

Example Data

The NEIME Kennouche 2019 (UniProt id: A0A1I9GEU1) dataset is used as an example. This dataset is stored in example_data/NEIME_2019 and contains the following:

[!NOTE] AssayMeta and DatasetMeta are just examples of possible meta tags one might think of. Current information in there is not associated to the dataset at all and not obtained from official sources.

[!NOTE] In Assay1.csv we also contain the split and engineering round column. Engineering round is randomly allocated to 1, 2 or 3 for illustrative purposes. Original assay belongs to a single engineering round. Split column converted the fold_random_5 from a k-split to train/val/test split with kfolds 0, 1, 2 in train, 3 in val, 4 in test.

.
├── example_data
│   └── NEIME_2019
│       ├── A0A1I9GEU1.fasta        # Parent sequence
│       ├── AssayMeta.json          # Example of possible AssayMeta
│       ├── Assays
│       │   └── Assay1.csv          # Tabular format of assay
│       ├── DataSetMeta.json        # Example of possible DatasetMeta
│       ├── sequences
│       │   └── A0A1I9GEU1.fasta    # Sequence referenced by the manifest
│       ├── MSA
│       │   ├── msa_weights.npy     # weights file for MSA as obtained from PG1.
│       │   ├── msa.a2m             # MSA file in .a2m format
│       │   ├── msa.a3m             # MSA file in .a3m format
│       │   └── msa.psi             # MSA file in .psi format
│       └── Structures              # 5 types of example structures with different
│           │                       # file types and sources for examples:
│           ├── experimental.cif
│           ├── experimental.bcif
│           ├── experimental.pdb
│           ├── computational.cif
│           └── computational.pdb

For a full overview of available data see the following table:

Dataset name Link to website Relative path to manifest
1. NEIME2019 www.proteingym.org example_data/neime_2019.toml
  • proteingym-benchmark: the benchmark that consumes these datasets, model cards and metrics.
  • evedesign: the framework the benchmark models run on; evedesign.proteingym converts Subsets into evedesign datatypes.

Metadata

Release files for proteingym-base 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for proteingym-base 0.2.0
File Size Uploaded Provenance Actions
proteingym_base-0.2.0.tar.gz 5.0 MB With provenance Details for proteingym_base-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for proteingym-base 0.2.0
File Interpreter ABI Platform Actions
proteingym_base-0.2.0-py3-none-any.whl Python 3 none any Details for proteingym_base-0.2.0-py3-none-any.whl

Total release size: 5.0 MB

Release files / proteingym_base-0.2.0.tar.gz

Download URL proteingym_base-0.2.0.tar.gz
Size 5.0 MB
Tags Source
SHA-256 checksum
How to use checksums
faec0dd6efca95a6b4b215ed8800017cfb86ecc51a0b4032228ff435ab15a35d
BLAKE2b-256 checksum
How to use checksums
3752f06e711f2a8933756fc92ca5a473d4197958332501409fd60df208f78fa2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / proteingym_base-0.2.0-py3-none-any.whl

Download URL proteingym_base-0.2.0-py3-none-any.whl
Size 67.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
74076095173530fcd265dfb08ede0e096b556c6629633dcb0e800734964ae13f
BLAKE2b-256 checksum
How to use checksums
b81366ef663c4a3882fd983403aff38fbc4b0ef375a4dc061fc01b9c28428c0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for proteingym-base 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for proteingym_base-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page