tcren — rank and inspect TCR–pMHC models
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.
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. AGENTS.md and the
API skill own repository and API guidance.
Metadata
Release files for tcren 4.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| tcren-4.1.0.tar.gz | 2.6 MB | With provenance | Details |
Built distributions (wheels)
Total release size: 38.6 MB
Release files / tcren-4.1.0.tar.gz
| Download URL | tcren-4.1.0.tar.gz |
|---|---|
| Size | 2.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed563f99704679c934e7e71bd7ff8ebb80cb7bf79f537c30093edd94a3e7e013
|
|
BLAKE2b-256 checksum How to use checksums |
c013b8fda3c32e076fd7c0bad376f509d094be4f671e7a51c829ef3c2e80b80d
|
| 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 22, 2026.
Transparency logRelease files / tcren-4.1.0-cp313-cp313-win_amd64.whl
| Download URL | tcren-4.1.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
0dcb6f2066a1486d76b34fc3785924a80741ccefa3a6f624735c3e0216961882
|
|
BLAKE2b-256 checksum How to use checksums |
e9798796dd7abc1dbfa06e85ad0e71a968e0ae302557735750af3cc9725790c1
|
| 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 22, 2026.
Transparency logRelease files / tcren-4.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | tcren-4.1.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 |
ddaae7a7db17d9d04ed72d0e770523eb0717074ceec22e643d0c5ccba2cc994e
|
|
BLAKE2b-256 checksum How to use checksums |
7ebc87d1fc7e38886b8d972dd47824bf94ad545c82a511397dd5bd99dabcdd87
|
| 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 22, 2026.
Transparency logRelease files / tcren-4.1.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | tcren-4.1.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 |
5c78c9be5e9b264cea3cc86203ab7c5546507a8a7446499b54a441aa41873cfa
|
|
BLAKE2b-256 checksum How to use checksums |
3dcf7daf3a9408b087298f609d7dc679e93e29a4e72aa6795729e2e5d953bd04
|
| 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 22, 2026.
Transparency logRelease files / tcren-4.1.0-cp312-cp312-win_amd64.whl
| Download URL | tcren-4.1.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f342daf895c298dc2d0823fb80eb9991b9bfd8b6e64a2378df650193e97ac029
|
|
BLAKE2b-256 checksum How to use checksums |
82509776c078aad59b7f83566e001a1ad4c7349dac7048448d8d534ffd6cb3a4
|
| 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 22, 2026.
Transparency logRelease files / tcren-4.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | tcren-4.1.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 |
a97dbfdec9188b731198259d6edac463f0cb6fc6cf5d15ae3ff2a49c5e029bd3
|
|
BLAKE2b-256 checksum How to use checksums |
bc09982c63d7c1c91f297372b28ec1f4f0129bac7c88565b44dd12af4abe797e
|
| 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 22, 2026.
Transparency logRelease files / tcren-4.1.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | tcren-4.1.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 |
3cac03b70490fd348fbae49039ea28793768f6de4dcebdf742f469253fac8911
|
|
BLAKE2b-256 checksum How to use checksums |
815f2fb7b0800efe5406e0ac03bbe72aa8e79927e989cc4b41e9f7e33be14451
|
| 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 22, 2026.
Transparency logRelease files / tcren-4.1.0-cp311-cp311-win_amd64.whl
| Download URL | tcren-4.1.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
35f63d1b8472fb26b17ba8d1dddc1105256ead63043c5e7d2615e259d80ac0d3
|
|
BLAKE2b-256 checksum How to use checksums |
ac93e55ddddcce003a18417d2810921095ca769e054ed53e86617c71f1b7eb80
|
| 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 22, 2026.
Transparency logRelease files / tcren-4.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | tcren-4.1.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 |
8628a3f06dd46ffe0180b2a886123a1f5baa4d423a3f552c47c57ceb560ae819
|
|
BLAKE2b-256 checksum How to use checksums |
1f2ddc367aa229e74eb8e0c51f983fbcb10c9e0a148fefdb76506cb807005166
|
| 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 22, 2026.
Transparency logRelease files / tcren-4.1.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | tcren-4.1.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 |
664bd1d7f3a9978162470ec214703f01b004cb5b67911412bdcde54c88ab4d93
|
|
BLAKE2b-256 checksum How to use checksums |
5e4f781290642e99d9c0e644e94616a0d004511534fd6d4592f982abd7e1c877
|
| 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 22, 2026.
Transparency logRelease files / tcren-4.1.0-cp310-cp310-win_amd64.whl
| Download URL | tcren-4.1.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9df99a1afbe5680debd2929f5ad2cb2fc20803f932b694c8ac40de2b6bb411b4
|
|
BLAKE2b-256 checksum How to use checksums |
6cd281f0d7eb35e55a84842aeeb9623f91bfb9db536bb49f9e8a0def6e0afe0a
|
| 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 22, 2026.
Transparency logRelease files / tcren-4.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | tcren-4.1.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 |
f9e5008b471b2b2ec4cde29914187612b4b8ff0cc4c58d5313d3ce8a797604ca
|
|
BLAKE2b-256 checksum How to use checksums |
e7c73d52de6b0f6358224caa75c7bbe7e1edcbeb1adfe820414539559f02472c
|
| 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 22, 2026.
Transparency logRelease files / tcren-4.1.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | tcren-4.1.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 |
f3ec53235ddb9e8dd56076bf4f13820921a8c0535152acf8fad32ab43e5a0197
|
|
BLAKE2b-256 checksum How to use checksums |
2ce01fc1be29ba69ddfd0e231a6fa29780d9ce3a4f6eaeef5828455634d1de76
|
| 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 22, 2026.
Transparency logSecurity for tcren 4.1.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.
Attestation for tcren-4.1.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 22, 2026.
Transparency logA 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.