Abstract
Recent advances in immunomics have shown that T-cell receptor (TCR) signatures can accurately predict active or recent infection by leveraging the high specificity of TCR binding to disease antigens. However, the extreme diversity of the adaptive immune repertoire presents challenges in reliably identifying disease-specific TCRs. Population genetics and sequencing depth can also have strong systematic effects on repertoires, which requires careful consideration when developing diagnostic models. We present an Adaptive Immune Repertoire-Invariant Variational Autoencoder (AIRIVA), a generative model that learns a low-dimensional, interpretable, and compositional representation of TCR repertoires to disentangle such systematic effects in repertoires. We apply AIRIVA to two infectious disease case-studies: COVID-19 (natural infection and vaccination) and the Herpes Simplex Virus (HSV-1 and HSV-2), and empirically show that we can disentangle the individual disease signals. We further demonstrate AIRIVA’s capability to: learn from unlabelled samples; generate in-silico TCR repertoires by intervening on the latent factors; and identify disease-associated TCRs validated using TCR annotations from external assay data.
Introduction
Our T-cell receptors (TCRs) act as a living record of every pathogen our bodies have ever encountered. "Immunomics"—the study of these TCR repertoires—holds the promise of "universal" diagnostics: a single blood test that could detect dozens of past or present infections.
However, two massive hurdles remain. First, TCR data is incredibly high-dimensional and sparse; a single person might have millions of unique TCRs, but only a tiny fraction relate to a specific disease. Second, the data is riddled with "systematic effects." Factors like sequencing depth or a person’s genetic background (HLA types) can drown out the actual disease signal. Standard models often struggle when signals overlap—for example, distinguishing between natural COVID-19 infection and vaccination.
The AIRIVA Framework
To address these challenges, we propose AIRIVA (Adaptive Immune Repertoire-Invariant Variational Autoencoder). AIRIVA is a deep generative model designed to disentangle disease-specific signals from systematic noise. It builds on the architecture of Domain Invariant VAEs (DIVA) but is tailored for the discrete, count-based nature of TCR data.
The core innovation is the split of the latent representation into two distinct parts:
- Predictive Latents ($Z_y^k$): Dimensions specifically constrained to represent labels like "COVID-positive" or "Vaccinated."
- Residual Latents ($Z_\epsilon$): Dimensions that capture everything else—sequencing depth, batch effects, and individual biological variation.
To enforce this split, the model uses an auxiliary classifier during training that "forces" the predictive latents to be informative about the disease labels.
In Silico Repertoire Generation and Counterfactuals
Once trained, AIRIVA acts as a simulator. By intervening on the latent factors—for instance, turning the "disease" knob up or down—researchers can generate counterfactual repertoires. This synthetic data shows what a specific patient's immune system might look like if their exposure history were different.
This "What-If" capability allows the model to calculate the Conditional Average Treatment Effect (CATE) for every single TCR sequence. By comparing a person's real repertoire to their synthetic "uninfected" counterfactual, researchers can rank which specific TCRs are most likely associated with a disease.
Experimental Results
We evaluated AIRIVA on two primary infectious disease case studies:
- COVID-19: Using a dataset of nearly 8,000 samples, AIRIVA significantly outperformed standard benchmarks at identifying natural infections in vaccinated populations. While other models' performance degraded when faced with vaccinated "controls," AIRIVA remained stable by explicitly modeling these as separate factors.
- Herpes Simplex Virus (HSV): In a dataset of ~1,400 samples, AIRIVA successfully separated HSV-1 from HSV-2 signals. These viruses share 80% of their genome, making their immune signatures very difficult to distinguish, yet AIRIVA maintained high accuracy for HSV-1 even in patients positive for both.
Validation using the MIRA assay (Multiplexed Identification of T cell Receptor Antigen specificity) confirmed the biological accuracy of the model, showing a 95% precision rate for spike-specific TCRs.
Conclusion and Future Work
AIRIVA demonstrates the power of disentangled generative models in immunomics. It not only improves diagnostic accuracy but also provides a tool for identifying disease-associated TCRs and generating synthetic immune data. Future work will focus on integrating HLA genetic information more deeply and exploring more flexible probability distributions to account for the over-dispersed nature of TCR counts.
Summary updated