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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af6c88dcc03f4f1e6d4a4f74977dfa2bc15a55a8128b7ec8ca783f36e83d8b7e
|
|
| MD5 |
6fd9693631c831d643c5a92adf280df4
|
|
| BLAKE2b-256 |
b4870222fed262b996097d41b459558988299824d13f16b0a65e34e41233dbb3
|
Provenance
The following attestation bundles were made for turep-0.1.0.tar.gz:
Publisher:
publish.yml on liuwd15/turep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
turep-0.1.0.tar.gz -
Subject digest:
af6c88dcc03f4f1e6d4a4f74977dfa2bc15a55a8128b7ec8ca783f36e83d8b7e - Sigstore transparency entry: 1393632852
- Sigstore integration time:
-
Permalink:
liuwd15/turep@1285fad7caba5ac8caa5cbda130c23c9b2d87855 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/liuwd15
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1285fad7caba5ac8caa5cbda130c23c9b2d87855 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
910a5db141a942045cf866e3bf4e8aac82e3fd747b3c73df6fbaf04f259ae225
|
|
| MD5 |
a1c9e2dce9384b32da55035854df3197
|
|
| BLAKE2b-256 |
5359e2115bc993429f681d57dd8acc79a8a8f2ed2b0dfb9601c6f275616c7283
|
Provenance
The following attestation bundles were made for turep-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on liuwd15/turep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
turep-0.1.0-py3-none-any.whl -
Subject digest:
910a5db141a942045cf866e3bf4e8aac82e3fd747b3c73df6fbaf04f259ae225 - Sigstore transparency entry: 1393632876
- Sigstore integration time:
-
Permalink:
liuwd15/turep@1285fad7caba5ac8caa5cbda130c23c9b2d87855 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/liuwd15
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1285fad7caba5ac8caa5cbda130c23c9b2d87855 -
Trigger Event:
release
-
Statement type: