TCR Repertoire Analysis Agent
The TCR Repertoire Analysis Agent provides comprehensive T-cell receptor repertoire analysis for cancer immunology applications. It leverages deep learning and multi-layer machine learning approaches to analyze TCR diversity, predict immunotherapy response, identify tumor-reactive TCRs, and support therapeutic TCR selection for cancer immunotherapy.
When to Use This Skill
- When analyzing TCR repertoire for cancer diagnosis and staging.
- For predicting immunotherapy (anti-PD-1/PD-L1) response from TCR profiles.
- To identify tumor-reactive TCRs for adoptive cell therapy.
- When monitoring treatment response through TCR clonality changes.
- For selecting therapeutic TCRs for TCR-T cell therapy development.
Core Capabilities
Repertoire Diversity Analysis: Quantify TCR diversity, clonality, and convergence.
Cancer Diagnosis: Distinguish cancer types from TCR signatures.
Immunotherapy Response Prediction: Predict checkpoint inhibitor response.
Tumor-Reactive TCR Identification: Find neoantigen-specific TCRs.
TCR-pMHC Binding Prediction: Predict TCR epitope specificity.
Clonal Dynamics Tracking: Monitor TCR clones during treatment.
TCR Repertoire Metrics
| Metric |
Definition |
Clinical Significance |
| Clonality |
Gini coefficient of clone sizes |
Immune focusing |
| Shannon Entropy |
Diversity measure |
Immune breadth |
| Richness |
Unique clonotypes |
Repertoire depth |
| Top Clone % |
Largest clone fraction |
Dominant response |
| Convergent TCRs |
Shared across patients |
Public epitope response |
| Tumor-Infiltrating % |
TIL-derived TCRs |
Tumor reactivity |
Workflow
Input: TCR-seq data (bulk or single-cell), clinical metadata.
Preprocessing: CDR3 extraction, error correction, clustering.
Repertoire Analysis: Calculate diversity, clonality, convergence.
ML Classification: Cancer type, stage, response prediction.
TCR Prioritization: Rank tumor-reactive TCR candidates.
TCR-pMHC Prediction: Predict epitope specificity.
Output: Repertoire metrics, predictions, therapeutic candidates.
Example Usage
User: "Analyze the TCR repertoire from this melanoma patient's tumor and blood to predict immunotherapy response and identify tumor-reactive TCRs."
Agent Action:
python3 Skills/Immunology_Vaccines/TCR_Repertoire_Analysis_Agent/tcr_repertoire_analysis.py \
--tumor_tcr tumor_tils.tsv \
--blood_tcr pbmc_tcrs.tsv \
--cancer_type melanoma \
--hla_type HLA-A*02:01,HLA-B*07:02 \
--neoantigens patient_neoantigens.fasta \
--task response_prediction,tcr_identification \
--output tcr_analysis/
Input Formats
| Format |
Source |
Fields |
| AIRR-seq |
Standardized |
CDR3, V/J genes, count |
| MiXCR |
MiXCR pipeline |
Clone info, counts |
| 10x VDJ |
Single-cell |
CDR3, cell barcode |
| Custom TSV |
Any pipeline |
Flexible mapping |
Output Components
| Output |
Description |
Format |
| Repertoire Metrics |
Diversity scores |
.json |
| Response Prediction |
Immunotherapy probability |
.json |
| Cancer Classification |
Type/stage prediction |
.json |
| Tumor-Reactive TCRs |
Ranked candidates |
.csv |
| TCR-pMHC Predictions |
Epitope specificity |
.csv |
| Clonal Tracking |
Dynamics over time |
.csv |
| Visualizations |
Repertoire plots |
.png, .pdf |
Response Prediction Features
| Feature Category |
Features |
Importance |
| Diversity |
Shannon, Gini, richness |
High |
| Clonality |
Top clones, expansion |
High |
| Convergence |
Public TCRs, sharing |
Moderate |
| Sequence Features |
CDR3 length, motifs |
Moderate |
| TIL Characteristics |
TIL fraction, phenotype |
High |
AI/ML Components
Cancer Classification:
- Multi-layer ensemble (XGBoost, RF, SVM)
- TCR embedding networks
- Attention-based sequence models
Response Prediction:
- Cox regression with TCR features
- Deep survival analysis
- Multi-task learning (response + survival)
TCR-pMHC Prediction:
- AlphaFold3-based structural prediction
- Transformer models (TCR-BERT)
- Contrastive learning embeddings
Clinical Applications
| Application |
TCR Biomarker |
Clinical Utility |
| Diagnosis |
Cancer-specific TCRs |
Early detection |
| Staging |
Clonality patterns |
Disease extent |
| Prognosis |
Intratumoral diversity |
Survival prediction |
| Response |
Baseline clonality |
IO response |
| Monitoring |
Clone dynamics |
Treatment tracking |
| Therapy |
Tumor-reactive TCRs |
TCR-T development |
Performance Benchmarks
| Task |
Dataset |
Performance |
| Cancer vs Normal |
Digestive cancers |
AUC 0.91 |
| Metastasis Detection |
CRC |
AUC 0.85 |
| IO Response |
Melanoma |
AUC 0.78 |
| TCR-pMHC Prediction |
IEDB benchmark |
AUC 0.82 |
Prerequisites
- Python 3.10+
- MiXCR, TRUST4 for TCR calling
- immunarch, tcrdist3
- PyTorch, transformers
- AlphaFold3 (optional, for structure)
Related Skills
- TCR_pMHC_Prediction_Agent - Detailed TCR-epitope prediction
- Neoantigen_Prediction_Agent - Neoantigen identification
- TME_Immune_Profiling_Agent - Broader immune context
- TCell_Exhaustion_Analysis_Agent - T cell phenotyping
TCR Sequence Analysis
| CDR3 Feature |
Analysis |
Meaning |
| Length Distribution |
Histogram |
V(D)J usage |
| Amino Acid Usage |
Positional frequency |
Binding properties |
| Hydrophobicity |
CDR3 profile |
MHC interaction |
| Charge |
Net charge |
Peptide binding |
| Motif Enrichment |
k-mer analysis |
Epitope specificity |
Therapeutic TCR Selection Criteria
| Criterion |
Threshold |
Rationale |
| Tumor Enrichment |
>10-fold vs blood |
Tumor specificity |
| Clone Size |
Top 1% in tumor |
Functional expansion |
| Neoantigen Binding |
Predicted positive |
Target specificity |
| Safety (Cross-react) |
No self-peptide hits |
Safety |
| HLA Restriction |
Common alleles |
Broad applicability |
Special Considerations
- Sample Quality: Fresh samples preferred for TIL analysis
- Sequencing Depth: Sufficient depth for rare clones
- Batch Effects: Normalize across sequencing runs
- HLA Context: TCR analysis requires HLA typing
- Paired Chains: Single-cell for alpha-beta pairing
Cancer-Specific TCR Signatures
| Cancer Type |
Key TCR Features |
Public TCRs |
| Melanoma |
High clonality, MAA-reactive |
Yes |
| NSCLC |
Moderate diversity |
Limited |
| CRC-MSI |
Neoantigen-reactive |
Variable |
| HPV+ HNSCC |
HPV-E6/E7 reactive |
Yes |
Author
AI Group - Biomedical AI Platform
1---2name: tcr-repertoire-analysis-agent3description: AI-powered T-cell receptor repertoire analysis for cancer diagnosis, immunotherapy response prediction, and therapeutic TCR selection using deep learning and multi-layer ML approaches.4---56<!--7# COPYRIGHT NOTICE8# This file is part of the "Universal Biomedical Skills" project.9# Copyright (c) 2026 MD BABU MIA, PhD <md.babu.mia@mssm.edu>10# All Rights Reserved.11#12# This code is proprietary and confidential.13# Unauthorized copying of this file, via any medium is strictly prohibited.14#15# Provenance: Authenticated by MD BABU MIA1617-->18192021# TCR Repertoire Analysis Agent2223The **TCR Repertoire Analysis Agent** provides comprehensive T-cell receptor repertoire analysis for cancer immunology applications. It leverages deep learning and multi-layer machine learning approaches to analyze TCR diversity, predict immunotherapy response, identify tumor-reactive TCRs, and support therapeutic TCR selection for cancer immunotherapy.2425## When to Use This Skill2627* When analyzing TCR repertoire for cancer diagnosis and staging.28* For predicting immunotherapy (anti-PD-1/PD-L1) response from TCR profiles.29* To identify tumor-reactive TCRs for adoptive cell therapy.30* When monitoring treatment response through TCR clonality changes.31* For selecting therapeutic TCRs for TCR-T cell therapy development.3233## Core Capabilities34351. **Repertoire Diversity Analysis**: Quantify TCR diversity, clonality, and convergence.36372. **Cancer Diagnosis**: Distinguish cancer types from TCR signatures.38393. **Immunotherapy Response Prediction**: Predict checkpoint inhibitor response.40414. **Tumor-Reactive TCR Identification**: Find neoantigen-specific TCRs.42435. **TCR-pMHC Binding Prediction**: Predict TCR epitope specificity.44456. **Clonal Dynamics Tracking**: Monitor TCR clones during treatment.4647## TCR Repertoire Metrics4849| Metric | Definition | Clinical Significance |50|--------|------------|----------------------|51| Clonality | Gini coefficient of clone sizes | Immune focusing |52| Shannon Entropy | Diversity measure | Immune breadth |53| Richness | Unique clonotypes | Repertoire depth |54| Top Clone % | Largest clone fraction | Dominant response |55| Convergent TCRs | Shared across patients | Public epitope response |56| Tumor-Infiltrating % | TIL-derived TCRs | Tumor reactivity |5758## Workflow59601. **Input**: TCR-seq data (bulk or single-cell), clinical metadata.61622. **Preprocessing**: CDR3 extraction, error correction, clustering.63643. **Repertoire Analysis**: Calculate diversity, clonality, convergence.65664. **ML Classification**: Cancer type, stage, response prediction.67685. **TCR Prioritization**: Rank tumor-reactive TCR candidates.69706. **TCR-pMHC Prediction**: Predict epitope specificity.71727. **Output**: Repertoire metrics, predictions, therapeutic candidates.7374## Example Usage7576**User**: "Analyze the TCR repertoire from this melanoma patient's tumor and blood to predict immunotherapy response and identify tumor-reactive TCRs."7778**Agent Action**:79```bash80python3 Skills/Immunology_Vaccines/TCR_Repertoire_Analysis_Agent/tcr_repertoire_analysis.py \81 --tumor_tcr tumor_tils.tsv \82 --blood_tcr pbmc_tcrs.tsv \83 --cancer_type melanoma \84 --hla_type HLA-A*02:01,HLA-B*07:02 \85 --neoantigens patient_neoantigens.fasta \86 --task response_prediction,tcr_identification \87 --output tcr_analysis/88```8990## Input Formats9192| Format | Source | Fields |93|--------|--------|--------|94| AIRR-seq | Standardized | CDR3, V/J genes, count |95| MiXCR | MiXCR pipeline | Clone info, counts |96| 10x VDJ | Single-cell | CDR3, cell barcode |97| Custom TSV | Any pipeline | Flexible mapping |9899## Output Components100101| Output | Description | Format |102|--------|-------------|--------|103| Repertoire Metrics | Diversity scores | .json |104| Response Prediction | Immunotherapy probability | .json |105| Cancer Classification | Type/stage prediction | .json |106| Tumor-Reactive TCRs | Ranked candidates | .csv |107| TCR-pMHC Predictions | Epitope specificity | .csv |108| Clonal Tracking | Dynamics over time | .csv |109| Visualizations | Repertoire plots | .png, .pdf |110111## Response Prediction Features112113| Feature Category | Features | Importance |114|------------------|----------|------------|115| Diversity | Shannon, Gini, richness | High |116| Clonality | Top clones, expansion | High |117| Convergence | Public TCRs, sharing | Moderate |118| Sequence Features | CDR3 length, motifs | Moderate |119| TIL Characteristics | TIL fraction, phenotype | High |120121## AI/ML Components122123**Cancer Classification**:124- Multi-layer ensemble (XGBoost, RF, SVM)125- TCR embedding networks126- Attention-based sequence models127128**Response Prediction**:129- Cox regression with TCR features130- Deep survival analysis131- Multi-task learning (response + survival)132133**TCR-pMHC Prediction**:134- AlphaFold3-based structural prediction135- Transformer models (TCR-BERT)136- Contrastive learning embeddings137138## Clinical Applications139140| Application | TCR Biomarker | Clinical Utility |141|-------------|---------------|------------------|142| Diagnosis | Cancer-specific TCRs | Early detection |143| Staging | Clonality patterns | Disease extent |144| Prognosis | Intratumoral diversity | Survival prediction |145| Response | Baseline clonality | IO response |146| Monitoring | Clone dynamics | Treatment tracking |147| Therapy | Tumor-reactive TCRs | TCR-T development |148149## Performance Benchmarks150151| Task | Dataset | Performance |152|------|---------|-------------|153| Cancer vs Normal | Digestive cancers | AUC 0.91 |154| Metastasis Detection | CRC | AUC 0.85 |155| IO Response | Melanoma | AUC 0.78 |156| TCR-pMHC Prediction | IEDB benchmark | AUC 0.82 |157158## Prerequisites159160* Python 3.10+161* MiXCR, TRUST4 for TCR calling162* immunarch, tcrdist3163* PyTorch, transformers164* AlphaFold3 (optional, for structure)165166## Related Skills167168* TCR_pMHC_Prediction_Agent - Detailed TCR-epitope prediction169* Neoantigen_Prediction_Agent - Neoantigen identification170* TME_Immune_Profiling_Agent - Broader immune context171* TCell_Exhaustion_Analysis_Agent - T cell phenotyping172173## TCR Sequence Analysis174175| CDR3 Feature | Analysis | Meaning |176|--------------|----------|---------|177| Length Distribution | Histogram | V(D)J usage |178| Amino Acid Usage | Positional frequency | Binding properties |179| Hydrophobicity | CDR3 profile | MHC interaction |180| Charge | Net charge | Peptide binding |181| Motif Enrichment | k-mer analysis | Epitope specificity |182183## Therapeutic TCR Selection Criteria184185| Criterion | Threshold | Rationale |186|-----------|-----------|-----------|187| Tumor Enrichment | >10-fold vs blood | Tumor specificity |188| Clone Size | Top 1% in tumor | Functional expansion |189| Neoantigen Binding | Predicted positive | Target specificity |190| Safety (Cross-react) | No self-peptide hits | Safety |191| HLA Restriction | Common alleles | Broad applicability |192193## Special Considerations1941951. **Sample Quality**: Fresh samples preferred for TIL analysis1962. **Sequencing Depth**: Sufficient depth for rare clones1973. **Batch Effects**: Normalize across sequencing runs1984. **HLA Context**: TCR analysis requires HLA typing1995. **Paired Chains**: Single-cell for alpha-beta pairing200201## Cancer-Specific TCR Signatures202203| Cancer Type | Key TCR Features | Public TCRs |204|-------------|------------------|-------------|205| Melanoma | High clonality, MAA-reactive | Yes |206| NSCLC | Moderate diversity | Limited |207| CRC-MSI | Neoantigen-reactive | Variable |208| HPV+ HNSCC | HPV-E6/E7 reactive | Yes |209210## Author211212AI Group - Biomedical AI Platform213214215<!-- AUTHOR_SIGNATURE: 9a7f3c2e-MD-BABU-MIA-2026-MSSM-SECURE -->