Intermediate representation and converters for protein folding model inputs
Project description
SPIR
SPIR (Structure Prediction Intermediate Representation) exists to make it practical to compare and iterate across multiple structure prediction models without constantly rewriting inputs by hand. Different predictors (AlphaFold3 Server/non-Server, Chai-1, Boltz-2, Protenix) can yield meaningfully different structures, confidence metrics, and binding/interface hypotheses on the same biological system; being able to run the same job across models is essential for validating conclusions, spotting model-specific artifacts, and choosing the best tool for a given target or constraint set.
In practice, such comparisons are hindered by the format fragmentation across different models, especially for glycans, where representations range from compact tree strings with implicit chemistry (e.g., AF3 Server) to fully specified multi-component ligands with explicitly specified bonded atom pairs. Reliably converting between formats requires more than renaming fields: it necessitates an intermediate graph-like representation that preserves residue identity, connectivity, attachment sites, and (when needed) explicit linkage atoms/positions, while also handling cases where a target format omits or infers chemistry. SPIR provides that IR together with model-specific converters so scientific questions, not input wrangling, drive the workflow.
Installation
The easiest way to install SPIR is to use pip:
pip install spir
If you want to build from source, you can clone the repository and run:
git clone https://github.com/briney/spir
cd spir
pip install -e .
Usage
SPIR provides a CLI for converting between different structure prediction model inputs.
spir convert --from DIALECT INPUT_FILE --to DIALECT OUTPUT_PREFIX
For example, to convert an AlphaFold3 Server input to an AlphaFold3 (non-Server) output, you can run:
spir convert --from alphafold3server path/to/input.json --to alphafold3 path/to/output
[!NOTE] The
output_prefixshould only contain the prefix for the output files (no extension). The correct extension will be added automatically.
If your input is Chai-1 formatted and includes restraints, you can specify the restraints file with the --restraints option:
spir convert --from chai1 input.fasta --to protenix output --restraints restraints.csv
Supported Models
SPIR supports the following structure prediction models:
| model | dialect |
|---|---|
| AlphaFold3 Server | alphafold3server |
| AlphaFold3 (non-Server) | alphafold3 |
| Boltz-2 | boltz2 |
| Chai-1 | chai1 |
| Protenix | protenix |
License
SPIR is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spir-0.1.0.tar.gz.
File metadata
- Download URL: spir-0.1.0.tar.gz
- Upload date:
- Size: 4.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
645fe20d0ee27572d228a879cf55d62ffabdff0d87d944513fb9b4e4b26d037c
|
|
| MD5 |
b8f20385d9868bfaded7af73e3fe0f80
|
|
| BLAKE2b-256 |
4bb5daa7516314577dff86593fa22dab9d585eba5500a4730cdf17c007822758
|
Provenance
The following attestation bundles were made for spir-0.1.0.tar.gz:
Publisher:
python-publish.yaml on briney/spir
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spir-0.1.0.tar.gz -
Subject digest:
645fe20d0ee27572d228a879cf55d62ffabdff0d87d944513fb9b4e4b26d037c - Sigstore transparency entry: 776079672
- Sigstore integration time:
-
Permalink:
briney/spir@3d55af2a6caaf78cbd492ee74a266928ce7db565 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/briney
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yaml@3d55af2a6caaf78cbd492ee74a266928ce7db565 -
Trigger Event:
release
-
Statement type:
File details
Details for the file spir-0.1.0-py3-none-any.whl.
File metadata
- Download URL: spir-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f61012e7b9166bb57bda7e9c1e0a5bf0c2d1e9e04d68bc6ed744bbb2c44f297
|
|
| MD5 |
441c7802c0c007e018d4d5b75e1254ad
|
|
| BLAKE2b-256 |
e2a108587ad43cf18b50db3be894fdc928b3d77a7d66942f8359192dbf498608
|
Provenance
The following attestation bundles were made for spir-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yaml on briney/spir
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spir-0.1.0-py3-none-any.whl -
Subject digest:
4f61012e7b9166bb57bda7e9c1e0a5bf0c2d1e9e04d68bc6ed744bbb2c44f297 - Sigstore transparency entry: 776079673
- Sigstore integration time:
-
Permalink:
briney/spir@3d55af2a6caaf78cbd492ee74a266928ce7db565 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/briney
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yaml@3d55af2a6caaf78cbd492ee74a266928ce7db565 -
Trigger Event:
release
-
Statement type: