DeepTCR is a deep learning framework for revealing sequence concepts within T-cell repertoires

John-William Sidhom, H. Benjamin Larman, Drew M. Pardoll, Alexander S. BarasNature Communications 2021

Abstract

Deep learning algorithms have been utilized to achieve enhanced performance in pattern-recognition tasks. The ability to learn complex patterns in data has tremendous implications in immunogenomics. T-cell receptor (TCR) sequencing assesses the diversity of the adaptive immune system and allows for modeling its sequence determinants of antigenicity. We present DeepTCR, a suite of unsupervised and supervised deep learning methods able to model highly complex TCR sequencing data by learning a joint representation of a TCR by its CDR3 sequences and V/D/J gene usage. We demonstrate the utility of deep learning to provide an improved 'featurization' of the TCR across multiple human and murine datasets, including improved classification of antigen-specific TCRs and extraction of antigen-specific TCRs from noisy single-cell RNA-Seq and T-cell culture-based assays. Our results highlight the flexibility and capacity for deep neural networks to extract meaningful information from complex immunogenomic data for both descriptive and predictive purposes.

Introduction

The adaptive immune system relies on T-cell receptors (TCRs) to recognize pathogens and tumors. While Next-Generation Sequencing (NGS) allows us to "read" these repertoires, interpreting them is difficult due to the high signal-to-noise ratio. In any given sample, the vast majority of T cells are "bystanders"—irrelevant to the specific disease being studied. Traditional analytical tools rely on sequence alignment or simple motif searches, which often fail to capture the complex, non-linear "grammar" of how a TCR binds to its target. DeepTCR addresses this by providing a comprehensive deep learning framework designed to "featurize" TCR sequencing data, turning complex protein sequences into meaningful numerical representations.

Methodology

DeepTCR introduces a modular suite of deep learning architectures built around a core TCR Featurization Block. This block allows the model to learn a joint representation of the TCR by integrating both sequence data and gene usage.

DeepTCR's TCR Featurization Block and Reconstruction Architecture

The framework utilizes several key components:

  • Joint Representation: DeepTCR uses a trainable embedding layer and a three-layer CNN to learn features from both the CDR3 sequences ($\alpha$ and $\beta$ chains) and categorical V/D/J gene usage.
  • Unsupervised Learning (VAE): A Variational Autoencoder compresses TCR data into a low-dimensional latent space, allowing for clustering TCRs by specificity without prior labels.
  • Supervised Learning: CNN-based classifiers predict antigen specificity and binding affinity.
  • Multi-Instance Learning (MIL): To handle whole-repertoire data, an attention-based MIL approach weighs individual sequences to identify the specific clones driving an immune response.

Key Results and Insights

A major finding is that combining sequence data with V/D/J gene usage significantly improves classification performance. DeepTCR learns "kernels" (motifs) representing the underlying rules of antigen recognition rather than just looking for exact matches.

Clustering Quality comparison across different algorithms

Key results include:

  • Superior Clustering: The VAE-based featurization outperformed state-of-the-art methods like GLIPH and TCRdist in grouping TCRs by known antigen specificity, as measured by Adjusted Mutual Information and Variance Ratio Criterion.
  • High Predictive Accuracy: Supervised models achieved high AUCs (>0.90) in classifying antigen-specific TCRs, outperforming Random Forests and SVMs.
  • Structural Validation: Using in silico mutagenesis, the model correctly identified contact residues previously confirmed by X-ray crystallography.

Conclusion

While DeepTCR is powerful, it remains data-hungry, and high-quality epitope-linked datasets are scarce. Future work involves incorporating Human Leukocyte Antigen (HLA) context and improving the interpretability of the learned "kernels" to further translate deep learning models into biological rules.

Summary updated

BibTeX
@inproceedings{sidhom2021deeptcr,
  author = {John-William Sidhom and H. Benjamin Larman and Drew M. Pardoll and Alexander S. Baras},
  title = {{DeepTCR is a deep learning framework for revealing sequence concepts within T-cell repertoires}},
  booktitle = {Nature Communications},
  year = {2021},
  doi = {10.1038/s41467-021-21879-w},
}
Figure