TCR2vec: a deep representation learning framework of T-cell receptor sequence and function
Yuepeng JiangiD, Miaozhe HuoiD, Pingping ZhangiD, Yiping ZouiD, Shuai Cheng LiiD
Abstract
The T-cell receptor (TCR) repertoires are critical components of the adaptive immune system, and machine learning methods were proposed to analyze the TCR repertoire data. However, most methods work solely on the hypervariable CDR3 regions of TCRs, overlooking the information encoded in other domains. Representing full TCRs as informative vectors can be indispensable for developing reliable and effective machine learning models. We introduce TCR2vec, a deep representation learning framework with 12 layers of transformer blocks, to pave the way for downstream modelings of full TCRs. Together with masked language modeling (MLM), we propose a novel pretraining task named similarity preservation modeling (SPM) to capture the sequence similarities of TCRs. Through a multi-task pretraining procedure on MLM and SPM, TCR2vec learns a contextual understanding of TCRs within a similarity-preserved vector space. We first verify the effectiveness of TCR2vec in predicting TCRs binding specificity and TCR clustering through comparison with three other embedding approaches. TCR2vec can be finetuned on small task-specific labeled data for enhanced performance, which outperforms state-of-the-art models by 2-25% in predicting TCRs binding specificity. Next, we compare the performance of two versions of TCR2vec pretrained on full TCRs (TCR2vec) or CDR3s (CDR3vec) and demonstrate that TCR2vec consistently outperforms CDR3vec by 12-14%. Further analysis of attention maps reveals that residues outside CDR3 also make notable contributions to the recognition of antigens. TCR2vec is available at https://github.com/jiangdada1221/TCR2vec.
02 /Specification & Classification
Click any tag to browse matching papers- Citations
- 9
- Assay
- Approach
Reproducibility ledger
Nobody has reported trying to reproduce this paper yet. Did you replicate an experiment or run the code? Your report saves the next lab a week.
Sign in to file a reproducibility report.
Related papers
- Context-Aware Amino Acid Embedding Advances Analysis of TCR-Epitope Interactions
Pengfei Zhang, Seojin Bang, … Heewook Lee·bioRxiv·Apr 12, 2023
- G2VTCR: predicting antigen binding specificity by Weisfeiler-Lehman graph embedding of T cell receptor sequences
Zicheng Wang, Yufeng Shen·bioRxiv·Apr 29, 2025
- TCR-BERT: learning the grammar of T-cell receptors for flexible antigen-binding analyses
Kevin Wu, Kathryn E. Yost, … James Zou·bioRxiv·Nov 18, 2021
- Designing meaningful continuous representations of T cell receptor sequences with deep generative models
Allen Y. Leary, Darius Scott, … Peter G. Hawkins·Nature CommunicationsPeer-reviewed·May 20, 2024
- Determining epitope specificity of T-cell receptors with transformers
Abdul Rehman Khan, Marcel J. T. Reinders, Indu Khatri·BioinformaticsPeer-reviewed·Oct 16, 2023
- meTCRs - Learning a metric for T-cell receptors
Felix Drost, Lennard Schiefelbein, Benjamin Schubert·bioRxiv·Oct 24, 2022