Skip to main content

ssrmsd

Self-consistency RMSD (ssRMSD) scoring for predicted antibody–antigen structure ensembles.

ssrmsd scores single or batched ensembles across heterogeneous structure predictors (e.g., AlphaFold3 .cif/.tar.gz/.zip mixed with ESMFold2 .pdb predictions), matching chains by sequence and computing both size-normalized upper-triangle metrics and legacy 5-sample AF3 parity metrics.

Features

  • Format & archive agnostic: reads .cif, .mmcif, .pdb, .ent (plain or .gz), plus .tar.gz/.tgz/.tar and .zip archives directly in memory with zero temp-file extraction.
  • AF3-aware discovery: auto-detects seed-*_sample-* subdirectories and excludes local AF3's duplicate top-level <job>_model.cif (override with --include-top-level or --glob).
  • Cross-model chain & residue matching: matches chains by overlap sequence identity via gemmi, splits ESMFold-style poly-G linkers (G{10,}), aligns shared Cα atoms across the entire ensemble, and guards against silent truncation or ambiguous homomer matching.
  • Flexible superposition: full-complex global Cα Kabsch by default, plus optional --align-chains / --score-chains (e.g., superpose on antigen, measure RMSD on antibody).
  • Comparable + legacy metrics: emits size-normalized metrics (mean_sq_rmsd, rms_rmsd, mean_rmsd, median_rmsd, rmsd_sd), legacy AF3 parity columns (ssRMSD, SD), and optional within-source vs. cross-source breakdowns.

Installation

Python 3.11+ (CPU-only; gemmi, numpy, and typer):

pip install ssRMSD

For local development:

pip install -e ".[dev]"
pytest

CLI Usage

Score a single ensemble

# Local AF3 job directory or archived .tar.gz / AlphaFold Server .zip
ssrmsd score /path/to/mab1_af3/
ssrmsd score /path/to/mab1.tar.gz

# Combine AF3 + ESMFold2 predictions into one ensemble, aligning on antigen (A) and scoring Fv (B,C)
ssrmsd score af3=af3_mab1.tar.gz esmfold=esm_mab1/ \
  --align-chains A --score-chains B,C \
  --pairwise-out pairs.csv -o score.csv

Score a batch of ensembles

# Join multiple predictor roots by matching subfolder/archive name (or flat <mab>_{model,sample}_<k> files)
ssrmsd batch \
  --dir af3=/data/af3_runs \
  --dir esmfold=/data/esm_runs \
  --join intersection \
  --workers 16 \
  -o scores.csv

# Arbitrary paths/sources via CSV or TSV manifest (columns: ensemble_id,path[,source])
ssrmsd batch --manifest ensembles.csv --workers 16 --format jsonl -o scores.jsonl

Output Columns

Column Description
ensemble_id Ensemble identifier
n_structures Number of structures $n$ in the ensemble
n_ca_align Common Cα atoms used for Kabsch superposition
n_ca_score Common Cα atoms measured in RMSD
mean_sq_rmsd Size-normalized ssRMSD: $\frac{1}{\binom{n}{2}} \sum_{i<j} d_{ij}^2 = \frac{\text{ssRMSD}}{n(n-1)}$ ($\text{Å}^2$)
rms_rmsd Root-mean-square pairwise RMSD: $\sqrt{\text{mean_sq_rmsd}}$ (Å)
mean_rmsd Mean upper-triangle pairwise RMSD (Å)
median_rmsd Median upper-triangle pairwise RMSD (Å)
rmsd_sd Population SD (ddof=0) of upper-triangle pairwise RMSDs (Å)
ssRMSD Legacy parity: $\sum_{i,j} M_{ij}^2 = 2\sum_{i<j} d_{ij}^2$
SD Legacy parity: np.std(M, ddof=0) over all $n^2$ entries including diagonal
within_source_mean_rmsd Mean pairwise RMSD for pairs from the same source (multi-source only)
cross_source_mean_rmsd Mean pairwise RMSD for pairs from different sources (multi-source only)
sources Per-source counts, e.g. af3:5,esmfold:3
status ok or error
error Diagnostic message when status=error

Python API

from pathlib import Path
from ssrmsd import ScoringOptions, StructureInput, score_ensemble

result = score_ensemble(
    [
        StructureInput(Path("af3_mab1.tar.gz"), source="af3"),
        StructureInput(Path("esm_mab1/"), source="esmfold"),
    ],
    ensemble_id="mab1",
    options=ScoringOptions(align_chains=("A",), score_chains=("B", "C")),
    include_pairwise=True,
)
print(result.rms_rmsd, result.ssRMSD, result.cross_source_mean_rmsd)

brineylab/toolshed Integration

ssrmsd is packaged as a CPU-only tool in brineylab/toolshed (tools/ssrmsd/):

Run locally with Podman or on Slurm with Pyxis:

podman run --rm -v "$PWD":/work -w /work \
  ghcr.io/brineylab/toolshed/ssrmsd:1.0.0 \
  ssrmsd batch --dir af3=af3_runs --dir esmfold=esm_runs -o scores.csv

License

MIT.

Metadata

Release files for ssRMSD 0.1.1

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

Source distribution (sdist)

Source distribution for ssRMSD 0.1.1
File Size Uploaded Provenance Actions
ssrmsd-0.1.1.tar.gz 62.4 kB With provenance Details for ssrmsd-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ssRMSD 0.1.1
File Interpreter ABI Platform Actions
ssrmsd-0.1.1-py3-none-any.whl Python 3 none any Details for ssrmsd-0.1.1-py3-none-any.whl

Total release size: 83.4 kB

Release files / ssrmsd-0.1.1.tar.gz

Download URL ssrmsd-0.1.1.tar.gz
Size 62.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ea88d928c6a5359b2a15ce035749d0426e5b42da0ac411df3f23405820e43cb4
BLAKE2b-256 checksum
How to use checksums
e32f4576d0a0ea4d8f0c9ac584a27edfbe7bdc90342cb7519580b4bfacf2eb08
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 24, 2026.

Transparency log

Release files / ssrmsd-0.1.1-py3-none-any.whl

Download URL ssrmsd-0.1.1-py3-none-any.whl
Size 21.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8773b7edcabcc975b7dcb4104b4b0a41ed3022f6e65171bbf3f39ff5c8673c91
BLAKE2b-256 checksum
How to use checksums
78d003102d94ba45f2a52edfd35d1741660a1ae2f4b667c7a1688794d7b043c1
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 24, 2026.

Transparency log

Security for ssRMSD 0.1.1

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 ssrmsd-0.1.1.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 24, 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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