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-agent-23description: 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.4license: MIT5---67# TCR Repertoire Analysis Agent89The **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.1011## When to Use This Skill1213* When analyzing TCR repertoire for cancer diagnosis and staging.14* For predicting immunotherapy (anti-PD-1/PD-L1) response from TCR profiles.15* To identify tumor-reactive TCRs for adoptive cell therapy.16* When monitoring treatment response through TCR clonality changes.17* For selecting therapeutic TCRs for TCR-T cell therapy development.1819## Core Capabilities20211. **Repertoire Diversity Analysis**: Quantify TCR diversity, clonality, and convergence.22232. **Cancer Diagnosis**: Distinguish cancer types from TCR signatures.24253. **Immunotherapy Response Prediction**: Predict checkpoint inhibitor response.26274. **Tumor-Reactive TCR Identification**: Find neoantigen-specific TCRs.28295. **TCR-pMHC Binding Prediction**: Predict TCR epitope specificity.30316. **Clonal Dynamics Tracking**: Monitor TCR clones during treatment.3233## TCR Repertoire Metrics3435| Metric | Definition | Clinical Significance |36|--------|------------|----------------------|37| Clonality | Gini coefficient of clone sizes | Immune focusing |38| Shannon Entropy | Diversity measure | Immune breadth |39| Richness | Unique clonotypes | Repertoire depth |40| Top Clone % | Largest clone fraction | Dominant response |41| Convergent TCRs | Shared across patients | Public epitope response |42| Tumor-Infiltrating % | TIL-derived TCRs | Tumor reactivity |4344## Workflow45461. **Input**: TCR-seq data (bulk or single-cell), clinical metadata.47482. **Preprocessing**: CDR3 extraction, error correction, clustering.49503. **Repertoire Analysis**: Calculate diversity, clonality, convergence.51524. **ML Classification**: Cancer type, stage, response prediction.53545. **TCR Prioritization**: Rank tumor-reactive TCR candidates.55566. **TCR-pMHC Prediction**: Predict epitope specificity.57587. **Output**: Repertoire metrics, predictions, therapeutic candidates.5960## Example Usage6162**User**: "Analyze the TCR repertoire from this melanoma patient's tumor and blood to predict immunotherapy response and identify tumor-reactive TCRs."6364**Agent Action**:65```bash66python3 Skills/Immunology_Vaccines/TCR_Repertoire_Analysis_Agent/tcr_repertoire_analysis.py \67 --tumor_tcr tumor_tils.tsv \68 --blood_tcr pbmc_tcrs.tsv \69 --cancer_type melanoma \70 --hla_type HLA-A*02:01,HLA-B*07:02 \71 --neoantigens patient_neoantigens.fasta \72 --task response_prediction,tcr_identification \73 --output tcr_analysis/74```7576## Input Formats7778| Format | Source | Fields |79|--------|--------|--------|80| AIRR-seq | Standardized | CDR3, V/J genes, count |81| MiXCR | MiXCR pipeline | Clone info, counts |82| 10x VDJ | Single-cell | CDR3, cell barcode |83| Custom TSV | Any pipeline | Flexible mapping |8485## Output Components8687| Output | Description | Format |88|--------|-------------|--------|89| Repertoire Metrics | Diversity scores | .json |90| Response Prediction | Immunotherapy probability | .json |91| Cancer Classification | Type/stage prediction | .json |92| Tumor-Reactive TCRs | Ranked candidates | .csv |93| TCR-pMHC Predictions | Epitope specificity | .csv |94| Clonal Tracking | Dynamics over time | .csv |95| Visualizations | Repertoire plots | .png, .pdf |9697## Response Prediction Features9899| Feature Category | Features | Importance |100|------------------|----------|------------|101| Diversity | Shannon, Gini, richness | High |102| Clonality | Top clones, expansion | High |103| Convergence | Public TCRs, sharing | Moderate |104| Sequence Features | CDR3 length, motifs | Moderate |105| TIL Characteristics | TIL fraction, phenotype | High |106107## AI/ML Components108109**Cancer Classification**:110- Multi-layer ensemble (XGBoost, RF, SVM)111- TCR embedding networks112- Attention-based sequence models113114**Response Prediction**:115- Cox regression with TCR features116- Deep survival analysis117- Multi-task learning (response + survival)118119**TCR-pMHC Prediction**:120- AlphaFold3-based structural prediction121- Transformer models (TCR-BERT)122- Contrastive learning embeddings123124## Clinical Applications125126| Application | TCR Biomarker | Clinical Utility |127|-------------|---------------|------------------|128| Diagnosis | Cancer-specific TCRs | Early detection |129| Staging | Clonality patterns | Disease extent |130| Prognosis | Intratumoral diversity | Survival prediction |131| Response | Baseline clonality | IO response |132| Monitoring | Clone dynamics | Treatment tracking |133| Therapy | Tumor-reactive TCRs | TCR-T development |134135## Performance Benchmarks136137| Task | Dataset | Performance |138|------|---------|-------------|139| Cancer vs Normal | Digestive cancers | AUC 0.91 |140| Metastasis Detection | CRC | AUC 0.85 |141| IO Response | Melanoma | AUC 0.78 |142| TCR-pMHC Prediction | IEDB benchmark | AUC 0.82 |143144## Prerequisites145146* Python 3.10+147* MiXCR, TRUST4 for TCR calling148* immunarch, tcrdist3149* PyTorch, transformers150* AlphaFold3 (optional, for structure)151152## Related Skills153154* TCR_pMHC_Prediction_Agent - Detailed TCR-epitope prediction155* Neoantigen_Prediction_Agent - Neoantigen identification156* TME_Immune_Profiling_Agent - Broader immune context157* TCell_Exhaustion_Analysis_Agent - T cell phenotyping158159## TCR Sequence Analysis160161| CDR3 Feature | Analysis | Meaning |162|--------------|----------|---------|163| Length Distribution | Histogram | V(D)J usage |164| Amino Acid Usage | Positional frequency | Binding properties |165| Hydrophobicity | CDR3 profile | MHC interaction |166| Charge | Net charge | Peptide binding |167| Motif Enrichment | k-mer analysis | Epitope specificity |168169## Therapeutic TCR Selection Criteria170171| Criterion | Threshold | Rationale |172|-----------|-----------|-----------|173| Tumor Enrichment | >10-fold vs blood | Tumor specificity |174| Clone Size | Top 1% in tumor | Functional expansion |175| Neoantigen Binding | Predicted positive | Target specificity |176| Safety (Cross-react) | No self-peptide hits | Safety |177| HLA Restriction | Common alleles | Broad applicability |178179## Special Considerations1801811. **Sample Quality**: Fresh samples preferred for TIL analysis1822. **Sequencing Depth**: Sufficient depth for rare clones1833. **Batch Effects**: Normalize across sequencing runs1844. **HLA Context**: TCR analysis requires HLA typing1855. **Paired Chains**: Single-cell for alpha-beta pairing186187## Cancer-Specific TCR Signatures188189| Cancer Type | Key TCR Features | Public TCRs |190|-------------|------------------|-------------|191| Melanoma | High clonality, MAA-reactive | Yes |192| NSCLC | Moderate diversity | Limited |193| CRC-MSI | Neoantigen-reactive | Variable |194| HPV+ HNSCC | HPV-E6/E7 reactive | Yes |195196## Author197198AI Group - Biomedical AI Platform