UMMS Affiliation

Program in Molecular Medicine; Department of Pathology

Publication Date


Document Type



Bioinformatics | Computational Biology | Immunology and Infectious Disease


BACKGROUND: With more T cell receptor sequence data becoming available, the need for bioinformatics approaches to predict T cell receptor specificity is even more pressing. Here we present SwarmTCR, a method that uses labeled sequence data to predict the specificity of T cell receptors using a nearest-neighbor approach. SwarmTCR works by optimizing the weights of the individual CDR regions to maximize classification performance.

RESULTS: We compared the performance of SwarmTCR against another nearest-neighbor method and showed that SwarmTCR performs well both with bulk sequencing data and with single cell data. In addition, we show that the weights returned by SwarmTCR are biologically interpretable.

CONCLUSIONS: Computationally predicting the specificity of T cell receptors can be a powerful tool to shed light on the immune response against infectious diseases and cancers, autoimmunity, cancer immunotherapy, and immunopathology. SwarmTCR is distributed freely under the terms of the GPL-3 license. The source code and all sequencing data are available at GitHub ( ).


Binding specificity, Immunoinformatics, TCR

Rights and Permissions

Copyright © The Author(s) 2021. Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit The Creative Commons Public Domain Dedication waiver ( applies to the data made available in this article, unless otherwise stated in a credit line to the data.

DOI of Published Version



Ehrlich R, Kamga L, Gil A, Luzuriaga K, Selin LK, Ghersi D. SwarmTCR: a computational approach to predict the specificity of T cell receptors. BMC Bioinformatics. 2021 Sep 7;22(1):422. doi: 10.1186/s12859-021-04335-w. PMID: 34493215; PMCID: PMC8422754. Link to article on publisher's site

Journal/Book/Conference Title

BMC bioinformatics

Related Resources

Link to Article in PubMed

PubMed ID


Creative Commons License

Creative Commons Attribution 4.0 License
This work is licensed under a Creative Commons Attribution 4.0 License.