Skip to main content

tcren

tcren — rank and inspect TCR–pMHC models

PyPI tests docs Python 3.10+ GPLv3

tcren ranks candidate αβ TCR:peptide–MHC structures and exposes the evidence behind the ranking: generator confidence, structural contact energy, interface geometry and contact topology. Start with a cohort of separately modelled candidates, or use the toolkit to inspect one structure or score peptides on a fixed template.

The scores are dimensionless structural readouts. They are not binding free energies, calibrated binding probabilities or affinity estimates. For receptor ranking, keep ipTM primary and inspect the structural components alongside it; the combination is not an established universal improvement over ipTM.

Install

pip install tcren
tcren build-mhc-ref

Binary wheels contain five native extensions. The runtime dependency arda-mapper annotates TCR chains and fetches its reference/search backend on first use. The MHC allele reference is built from IMGT on demand. See the installation guide for reference data, supported environments and first-run behavior.

For development, use the repository's isolated environment:

bash setup.sh
source .venv/bin/activate

Start with one ranking task

tcren screen -s models.tar.gz -o scores.tsv
# Optional table with unique complex.id and iptm columns:
tcren screen -s models.tar.gz --confidence confidence.tsv -o scores.tsv

A cohort holds one side fixed:

Task Fixed side Varying side Structural alanine reference
Epitope ranking receptor peptide epitope positions
TCR ranking pMHC receptor contacted CDR residues

Automatic detection reads the annotated peptide and CDR3 pair. Keep one MHC background and verify experimental identities before joining labels. A mixed set or a set where nothing varies is refused. Missing ipTM is reported; tcren reads it from metadata or the confidence table and does not calculate generator confidence.

Task-matched screening workflow

The structural reference truncates side chains to alanine in three dimensions, retains backbone and Cβ atoms, and rebuilds contacts. It is not a virtual identity substitution on a fixed contact map. The selected side follows the ranking task.

Read the evidence and the score

screen reports raw components, standardized contributions, missingness, cohort flags and a provenance sidecar containing the frozen-reference identity.

  • Confidence: the generator's iptm.
  • Energy: the structural alanine difference on the TCR:peptide interface.
  • Geometry: height-field Pearson complementarity, sc_shape.
  • Topology: CDR:pMHC graph cycle fraction, g_cyclo_frac; carried for TCR ranking.

Components use frozen raw-column means and scales, then a declared direction. Weighted Stouffer combines the observed standardized components. TCR ranking gives confidence weight 0.8 and shares 0.2 across the structural components; epitope ranking gives energy and confidence equal weights. These empirical reference constants are estimated dependencies, not query-derived parameters. Nothing is fitted or normalized against the query cohort.

Models with zero TCR:peptide contacts remain in output with a discard reason and no score. They do not count toward the default floor of 30 models with an interface. Smaller cohorts report components alone. Flags report by default. --on-flag explicitly selects report, structure, geometry, withhold or reverse; responses cannot restore unavailable scores. Reversal is not recommended as a correction for modelling failures.

The screening guide defines every component, its units, the combination equations, missingness and output fields. The inspection guide explains how to read those outputs. Keep MHC class, epitope and template coverage explicit when making comparisons. High peptide-ranking accuracy alone does not establish receptor specificity across epitopes.

Use the toolkit for a particular quantity

Need Entry point
Rank from an existing structural epitope-energy/ipTM table tcren rank-epitopes
Thread candidate peptides on one fixed structure tcren score
Structural alanine difference for candidate poses tcren scoring --delta --reference-mode structural
Structural contacted-CDR reference tcren export --quantity receptor-reference --reference-mode structural
Individual geometry, topology and energy descriptors tcren features
Chain/region annotation and residue contacts tcren annotate, tcren contacts
Canonical MHC frame tcren superimpose
pMHC surface relief, charge and hydropathy tcren surface
Pose/confidence diagnostics and matched comparisons tcren inspect-models, tcren associate
Trajectory and mechanical readouts tcren md, tcren mechanics

Fixed-template threading and separately modelled candidates are distinct protocols. features retains historical fixed-map dPhi columns; use the explicit structural scoring/export routes above for the current alanine reference. The full API reference documents library calls, experimental contact layers and supported historical reproduction APIs.

Historical recognize, assess and fitted Potts readouts retain their dependencies and reproduction contracts; they are not the current screen. The integral/GLM commands were withdrawn. See reference dependencies and SOURCES for parameter provenance and resource identities.

Development and verification

./setup.sh --tests
.venv/bin/ruff check src tests
source .venv/bin/activate
make -C docs html SPHINXOPTS=-W

Use .venv/bin/python -m pytest -m 'not slow' for the non-slow suite; scientific benchmarks are separate from software checks. Rebuild the editable install after native changes. Scientific campaigns, old results and publication figures are maintained with the benchmark and manuscript repositories. CHANGELOG.md records software changes. The API skill owns API guidance.

Metadata

Release files for tcren 4.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 tcren 4.2.0
File Size Uploaded Provenance
tcren-4.2.0.tar.gz 2.5 MB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for tcren 4.2.0
File
tcren-4.2.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
tcren-4.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
tcren-4.2.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
tcren-4.2.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
tcren-4.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
tcren-4.2.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
tcren-4.2.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
tcren-4.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
tcren-4.2.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
tcren-4.2.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
tcren-4.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
tcren-4.2.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details

Total release size: 38.4 MB

Release files / tcren-4.2.0.tar.gz

Download URL tcren-4.2.0.tar.gz
Size 2.5 MB
Tags Source
SHA-256 checksum
How to use checksums
1df921f6825ade05d004ac1871b6f17b35e8c9796214e432c9310568a811fd96
BLAKE2b-256 checksum
How to use checksums
9efcce002b055903f27c1f752689da018582d61efb0e5a44a2e082bab26b0846
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 Oct 23, 2026.

Transparency log

Release files / tcren-4.2.0-cp313-cp313-win_amd64.whl

Download URL tcren-4.2.0-cp313-cp313-win_amd64.whl
Size 3.0 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
b8e65da141f6a8c2b1633236e8fdd385df8c066cf070bf2975ba21baa40071fc
BLAKE2b-256 checksum
How to use checksums
60964493009b7eaf2700881b0187fa25ce3069cf7fab26c99253aa50de62dafe
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 Oct 23, 2026.

Transparency log

Release files / tcren-4.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL tcren-4.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.1 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
762b1129bfe4c6d8872398f936a58969953b7aa8966956318bb113084d41cbf0
BLAKE2b-256 checksum
How to use checksums
080a6fadac01f31a7d4ef38d0f8236d969ccb016c0bf754e87ac27ab4250cc65
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 Oct 23, 2026.

Transparency log

Release files / tcren-4.2.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL tcren-4.2.0-cp313-cp313-macosx_11_0_arm64.whl
Size 2.9 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ae6a9753bbdd852e48e4f3c656788c024304ec1d19253c9aca09729a08fa75d3
BLAKE2b-256 checksum
How to use checksums
443231e5415f2c1da2ba22d5c09239421adabd9415d057f1c70827945d83fdb2
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 Oct 23, 2026.

Transparency log

Release files / tcren-4.2.0-cp312-cp312-win_amd64.whl

Download URL tcren-4.2.0-cp312-cp312-win_amd64.whl
Size 3.0 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
54a50938a503080a6a3187494e3d91457689ea6d1d0d33162d65318a09632d48
BLAKE2b-256 checksum
How to use checksums
05e1323cc6004e3611d85461cfd32f5e7addadfbe42a92d92f8e01872c8830e8
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 Oct 23, 2026.

Transparency log

Release files / tcren-4.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL tcren-4.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.1 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
c5c06005e86e5f4f0006b4e82df3b7209afbf7d7cb2dc17f86bd1fa17de54596
BLAKE2b-256 checksum
How to use checksums
6e6cf2c2faa4967e35d43bf75da3743935daebb90e3ad47c3a8e3aaa21db97ae
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 Oct 23, 2026.

Transparency log

Release files / tcren-4.2.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL tcren-4.2.0-cp312-cp312-macosx_11_0_arm64.whl
Size 2.9 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
51065736f7a985d18d3cc2ab992eb48c7093f8b83fcf8f395b80ffa063d7802a
BLAKE2b-256 checksum
How to use checksums
10db8a6655e106caa9daea42acc8d31309a89808b6088073676cc816794f4cd9
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 Oct 23, 2026.

Transparency log

Release files / tcren-4.2.0-cp311-cp311-win_amd64.whl

Download URL tcren-4.2.0-cp311-cp311-win_amd64.whl
Size 3.0 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
b0fe570dac736f06f208be82ac3f7ed431cf9b0277205123cac1778ed0ea8aac
BLAKE2b-256 checksum
How to use checksums
1bb8f13261a36b697b7a7aaba9a0298b0cb09e313e35818dad924a970ebb1fe7
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 Oct 23, 2026.

Transparency log

Release files / tcren-4.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL tcren-4.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.1 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
93af8f035b3940359c1255022dd313a471ab6cec73df5467eaf8bc5b2ce36361
BLAKE2b-256 checksum
How to use checksums
874f7113fc81af6677ab12d0419fc85a4691bb72da38d1979e671f359388a412
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 Oct 23, 2026.

Transparency log

Release files / tcren-4.2.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL tcren-4.2.0-cp311-cp311-macosx_11_0_arm64.whl
Size 2.9 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6610bb1a46a9ee574ecff9274e32333b733f9cf36f27855a556aed363ce3100e
BLAKE2b-256 checksum
How to use checksums
a338cf89455e4557e20dac80ffbfc128602817807093bda4757d391fbcf29fbb
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 Oct 23, 2026.

Transparency log

Release files / tcren-4.2.0-cp310-cp310-win_amd64.whl

Download URL tcren-4.2.0-cp310-cp310-win_amd64.whl
Size 3.0 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
9e73ebb735f5d2b4367aabfb29b4a6f9c405899de5e6ceb5e8f6871ec227e13e
BLAKE2b-256 checksum
How to use checksums
dadd65403be66d728be0e85ba0a2d68661703f51f4a3af939bf1362f548fbb12
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 Oct 23, 2026.

Transparency log

Release files / tcren-4.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL tcren-4.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
7a20286e0041cb60a497bdd75d238649fa443508e42179af54579ca4369b21dd
BLAKE2b-256 checksum
How to use checksums
037eadf5828a71d471a62384e68bfb6e54e8b38c9b83b96033254b827c80b366
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 Oct 23, 2026.

Transparency log

Release files / tcren-4.2.0-cp310-cp310-macosx_11_0_arm64.whl

Download URL tcren-4.2.0-cp310-cp310-macosx_11_0_arm64.whl
Size 2.9 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
49189a03f0f50dcee846696b59fd8447bd975e1f643d24f7572bfd74a2ca5c6d
BLAKE2b-256 checksum
How to use checksums
fad4e0655885fe3ab0c83a147d8d7b8abd406f1450666bc5ece391729768b6fd
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 Oct 23, 2026.

Transparency log

Security for tcren 4.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

All 13 files in this release have been uploaded with provenance metadata.

Select from 13 files

Attestation for tcren-4.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 Oct 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