Skip to main content

Tumor-reactivity prediction for single-cell and spatial transcriptomics data.

Project description

Turep

Cross-cancer tumor-reactive CD8+ T cell prediction

turep is a Python package for predicting tumor-reactive CD8+ T cells from single-cell and spatial transcriptomics data across solid tumors.

Installation

From Pypi

pip install turep

From source

cd turep
pip install -e .

Usage

scRNA-seq prediction (Turep-sc)

Use the hosted pre-trained model and run prediction directly on query data.

from turep import load_model, predict_tr

# Load the hosted pre-trained turep model.
# The pretrained model will be downloaded during the first run
turep_model = load_model()

# adata_query is an AnnData input with a column "sample_id" indicating
# biological sample. It should be subsetted to include CD8+ T cells.
adata_query = ... 
adata_query = predict_tr(adata_query, turep_model, "sample_id")
head(adata_query.obs)

Predictions are written to adata_query.obs["label_pred"] and adata_query.obs["score_pred"].

If you have TCR clonotype information saved in a column of adata_query.obs, The tumor-reactive probability of TCR clonotypes can be predicted based on Turep score prediction.

from turep import get_top_clonotype

# Uses adata_query.obs["clone_id"] and adata_query.obs["score_pred"] by default
top_clonotypes = get_top_clonotype(adata_query, clonotype_key="clone_id", K=5, C=0.5)
print(top_clonotypes.head())

Spatial transcriptomics prediction (Turep-st)

Factor disentanglement VAE models with focal loss that separate batch effects, biological labels, and residual variation.

from turep import load_model, predict_tr_spatial

adata_ref = load_model().adata

# adata_query is an AnnData input with a column "sample_id" indicating
# biological sample. It should be subsetted to include CD8+ T cells.
adata_query = ... 
adata_query = predict_tr_spatial(adata_query, adata_ref, "sample_id")
head(adata_query.obs)

Resources

The notebooks and scripts for reproducing and visualizing results in our manuscript are available at turep_notebooks.

Citation

If you use this package in your research, please cite our preprint: Liu et al. bioRxiv. 2026.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

turep-0.1.0.tar.gz (44.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

turep-0.1.0-py3-none-any.whl (33.6 kB view details)

Uploaded Python 3

File details

Details for the file turep-0.1.0.tar.gz.

File metadata

  • Download URL: turep-0.1.0.tar.gz
  • Upload date:
  • Size: 44.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for turep-0.1.0.tar.gz
Algorithm Hash digest
SHA256 af6c88dcc03f4f1e6d4a4f74977dfa2bc15a55a8128b7ec8ca783f36e83d8b7e
MD5 6fd9693631c831d643c5a92adf280df4
BLAKE2b-256 b4870222fed262b996097d41b459558988299824d13f16b0a65e34e41233dbb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for turep-0.1.0.tar.gz:

Publisher: publish.yml on liuwd15/turep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file turep-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: turep-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for turep-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 910a5db141a942045cf866e3bf4e8aac82e3fd747b3c73df6fbaf04f259ae225
MD5 a1c9e2dce9384b32da55035854df3197
BLAKE2b-256 5359e2115bc993429f681d57dd8acc79a8a8f2ed2b0dfb9601c6f275616c7283

See more details on using hashes here.

Provenance

The following attestation bundles were made for turep-0.1.0-py3-none-any.whl:

Publisher: publish.yml on liuwd15/turep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page