Skip to main content

TCRsift

Tests Documentation Coverage Status PyPI version

Prioritize T-cell receptor clonotypes from paired 10x Genomics single-cell VDJ and gene-expression data for human (Homo sapiens) and mouse (Mus musculus) studies. Standard Cell Ranger directories serve as input: cellranger vdj supplies TCR contigs and clonotypes, and cellranger count supplies gene expression for CD4/CD8 phenotyping, signature scoring, and cell-type annotation (VDJ-only workflows are also supported).

TCRsift combines clonal abundance, T-cell lineage, gene-expression state signatures, public TCR database matches (VDJdb, IEDB, CEDAR), sequence generation probability (Pgen/Ppost), and optional TIL overlap to produce auditable shortlists and full-length receptor constructs. None of these signals predicts epitope specificity on its own; functional testing is still required.

Documentation & Benchmarks

Installation

pip install tcrsift

Optional extras (sequence assembly, Excel I/O, PDF reports, oncoref CTA panels, and bundled NumPy k-mer Pgen/Ppost models are included in the base install):

pip install "tcrsift[full]"     # All optional extras below
pip install "tcrsift[tcrpeg]"   # Deep autoregressive TCRpeg/PyTorch sequence probability
pip install "tcrsift[atlas]"    # Harmony + Leiden clustering (`tcrsift cells embed`)
pip install "tcrsift[plots]"    # UpSet and Venn set-overlap plots

See Installation for source installs and environment details.

Quick Start

Create samples.yaml pointing to your Cell Ranger output directories (YAML and CSV formats are both supported; see Sample Sheets):

samples:
  - sample: "Patient1_Culture"
    vdj_dir: "/data/patient1/vdj"
    gex_dir: "/data/patient1/gex"

Run the antigen-stimulated culture pipeline (optionally fetch VDJdb/IEDB/CEDAR and IMGT germlines once with tcrsift data download):

tcrsift data download
tcrsift run --sample-sheet samples.yaml --output-dir results/

Or rank clones by expression state in fresh TIL, blood, pleural effusion, or marrow and assemble full-length β-T2A-α constructs in one command:

tcrsift prioritize til_samples.yaml -o candidates/ --context solid-tumor --assemble

Python API

import tcrsift

adata = tcrsift.load_samples("samples.yaml")
adata = tcrsift.phenotype_cells(adata)
clonotypes = tcrsift.aggregate_clonotypes(adata)
filtered = tcrsift.filter_clonotypes(clonotypes, method="threshold", tcell_type="cd8")
annotated = tcrsift.annotate_clonotypes(filtered, vdjdb_path="/path/to/vdjdb")
assembled = tcrsift.assemble_full_sequences(annotated, include_constant=True)

See Quick Start and the Python API reference for full examples.

Choose a Workflow

All workflows share loading, CD4/CD8 phenotyping, database annotation, and construct assembly; only clonotype scoring changes with experimental design:

Study design Command Guide
Fresh TIL, blood, MPE, or marrow (paired VDJ + GEX, human or mouse) tcrsift prioritize samples.yaml -o out/ --context solid-tumor [--assemble] Clone Prioritization
Antigen-stimulated culture or short restimulation (with optional matched TIL) tcrsift run -s samples.yaml -o out/ [--method {threshold,logistic,stimulation}] Culture Pipeline
Standalone full-length TCR construct assembly from a clone CSV tcrsift assemble -i clones.csv -o seqs.csv [--contigs-dir ...] CLI Reference
Single-cell GEX QC, Harmony/UMAP/Leiden embedding, and cell typing tcrsift cells {qc,embed,annotate} Single-Cell Atlas
Reference database & IMGT germline cache management tcrsift data {list,download,clear} CLI Reference

Additional utilities (match-til, til-clonotype, til-select, load-sct, annotate-gex, unify, mnemonic, report) are documented in the CLI Reference.

Architecture

Cell Ranger VDJ + GEX
  │
  ▼
1. Load & QC           (tcrsift load)       Paired α/β productive chains + GEX mito/UMI/CD3 QC
  │
  ▼
2. Phenotype & Clone   (phenotype/clonotype) CD4/CD8 lineage (FACS pre_sorted aware) + k-mer Pgen/Ppost
  │
  ├──► Ex vivo tissue/blood (`tcrsift prioritize`):
  │      3. Per-stratum signature scoring + size-matched random-group & hypergeometric calibration
  │      4. Priority-tiered round-robin shortlist + strict_ab DB / FOXP3 Treg / multimer audit
  │
  └──► Stimulated culture (`tcrsift run`):
         3. Expansion tiers (`threshold`/`logistic`) or paired control ΔAIM (`stimulation`) + TIL match
         4. Per-donor / per-method shortlist + VDJdb/IEDB/CEDAR specificity annotation
  │
  ▼
5. Construct Assembly  (`--assemble` / `tcrsift assemble`)
                       Donor-contig V(D)J + native leaders + canonical human/mouse TRAC/TRBC1/2
                       (with optional `--germline-vdj-fallback` + J->C parity correction)
  • Inputs: Cell Ranger VDJ (filtered_contig_annotations.csv, optional filtered_contig.fasta / consensus_annotations.csv) and GEX (filtered_feature_bc_matrix/ or .h5). Exact barcode matching with suffix-stripped fallback when needed.
  • Outputs: Per-cell AnnData (loaded.h5ad, phenotyped.h5ad), clonotype tables (data/clonotypes.csv, filtered_tier*.csv, or candidate_clones.csv from prioritize), assembled sequences (data/full_sequences.csv, FASTA/PDF), summary plots, and provenance.json.

See How TCRsift works and Filtering Strategies for algorithms, column schemas, and multi-donor/multi-method configuration.

Contributing and License

See CONTRIBUTING.md for development guidelines. Licensed under the Apache License 2.0 (LICENSE).

Citation

@software{tcrsift,
  author = {Rubinsteyn, Alex},
  title = {TCRsift: T-cell receptor clonotype prioritization from single-cell VDJ and gene-expression data},
  url = {https://github.com/pirl-unc/tcrsift},
  year = {2024}
}

Metadata

Release files for tcrsift 3.44.14

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

Source distribution (sdist)

Source distribution for tcrsift 3.44.14
File Size Uploaded Provenance Actions
tcrsift-3.44.14.tar.gz 1.4 MB Without provenance Details for tcrsift-3.44.14.tar.gz

Built distribution (wheel)

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

Total release size: 2.5 MB

Release files / tcrsift-3.44.14.tar.gz

Download URL tcrsift-3.44.14.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
6c652f1e0a7cf529b8242f6ba189ebc7d52566e7bea5f8a787787ded3a6a1cf0
BLAKE2b-256 checksum
How to use checksums
680765950791666b2da63091993971951130f4ba900ec46e43c06146e80fd980
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.6

Release files / tcrsift-3.44.14-py3-none-any.whl

Download URL tcrsift-3.44.14-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
f6b6662c4bcd8d5af0bb44e18e0ab1779255f0baf4cbf6e4611fa38abde79cc9
BLAKE2b-256 checksum
How to use checksums
e595fd97faa9bb083cc4b6f2e34b479476f64c004ae9a001e27827c2000c66f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.6

Security for tcrsift 3.44.14

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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

3.44.14 This release

2 release files No 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