Skip to main content

Fast and performant TCR representation model

Project description

Latest release Tests Documentation Status License DOI

Check out the documentation page.


SCEPTR (Simple Contrastive Embedding of the Primary sequence of T cell Receptors) is a small, fast, and accurate TCR representation model that can be used for alignment-free TCR analysis, including for TCR-pMHC interaction prediction and TCR clustering (metaclonotype discovery). Our manuscript demonstrates that SCEPTR can be used for few-shot TCR specificity prediction with improved accuracy over previous methods.

SCEPTR is a BERT-like transformer-based neural network implemented in Pytorch. With the default model providing best-in-class performance with only 153,108 parameters (typical protein language models have tens or hundreds of millions), SCEPTR runs fast- even on a CPU! And if your computer does have a CUDA-enabled GPU, the sceptr package will automatically detect and use it, giving you blazingly fast performance without the hassle.

sceptr's API exposes three intuitive functions: calc_vector_representations, calc_cdist_matrix, and calc_pdist_vector- and it's all you need to make full use of the SCEPTR models. What's even better is that they are fully compliant with pyrepseq's tcr_metric API, so sceptr will fit snugly into the rest of your repertoire analysis workflow.

Installation

pip install sceptr

Citing SCEPTR

Please cite our manuscript.

BibTex

@article{nagano_contrastive_2025,
	title = {Contrastive learning of {T} cell receptor representations},
	volume = {16},
	issn = {2405-4712, 2405-4720},
	url = {https://www.cell.com/cell-systems/abstract/S2405-4712(24)00369-7},
	doi = {10.1016/j.cels.2024.12.006},
	language = {English},
	number = {1},
	urldate = {2025-01-19},
	journal = {Cell Systems},
	author = {Nagano, Yuta and Pyo, Andrew G. T. and Milighetti, Martina and Henderson, James and Shawe-Taylor, John and Chain, Benny and Tiffeau-Mayer, Andreas},
	month = jan,
	year = {2025},
	pmid = {39778580},
	note = {Publisher: Elsevier},
	keywords = {contrastive learning, protein language models, representation learning, T cell receptor, T cell specificity, TCR, TCR repertoire},
}

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

sceptr-1.1.0.post2.tar.gz (10.7 MB view details)

Uploaded Source

Built Distribution

sceptr-1.1.0.post2-py3-none-any.whl (10.7 MB view details)

Uploaded Python 3

File details

Details for the file sceptr-1.1.0.post2.tar.gz.

File metadata

  • Download URL: sceptr-1.1.0.post2.tar.gz
  • Upload date:
  • Size: 10.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for sceptr-1.1.0.post2.tar.gz
Algorithm Hash digest
SHA256 0e2caff556045dd1f8e5f479cd33b2e3fc892c649e1c66a07698b338eb793d87
MD5 b37c45abd6066fd8015a5ec2ce860f18
BLAKE2b-256 6d2a6b3cfa4795ce76991de1011e702a11bdf5828f3bd83671abeaec7d7ad72e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sceptr-1.1.0.post2.tar.gz:

Publisher: publish_to_pypi.yaml on yutanagano/sceptr

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

File details

Details for the file sceptr-1.1.0.post2-py3-none-any.whl.

File metadata

  • Download URL: sceptr-1.1.0.post2-py3-none-any.whl
  • Upload date:
  • Size: 10.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for sceptr-1.1.0.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 634782f1a82eaa5534f603d6173893beb9d0be85f67d8174735546e7456b0831
MD5 a53a3c776877966448798fa9324e5923
BLAKE2b-256 0da5bf2ee7426f9c783761586da8ce1fba6f4e1b1e372f22815218d170345f15

See more details on using hashes here.

Provenance

The following attestation bundles were made for sceptr-1.1.0.post2-py3-none-any.whl:

Publisher: publish_to_pypi.yaml on yutanagano/sceptr

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

Supported by

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