tooluniverse-immune-repertoire-analysis

Analyzes TCR and BCR repertoire sequencing data for clonality, diversity, and antigen specificity.

1.7k|254|Updated Mar 3, 2025
One-click install
npx skills add https://github.com/mims-harvard/ToolUniverse --skill tooluniverse-immune-repertoire-analysis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tooluniverse-immune-repertoire-analysis
Source: https://github.com/mims-harvard/ToolUniverse/tree/main/plugins/tooluniverse/skills/tooluniverse-immune-repertoire-analysis
Command: npx skills add https://github.com/mims-harvard/ToolUniverse --skill tooluniverse-immune-repertoire-analysis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandas, numpy, scipy, scanpy, tooluniverse.

What problem does it solve?

Characterizing adaptive immune responses from AIRR-seq data requires many fragmented steps: parsing MiXCR/ImmunoSEQ/10x outputs, computing diversity metrics, detecting clonal expansion, and matching clones to known epitopes. This Skill consolidates that into a single 8-phase workflow so researchers can go from raw repertoire files to interpretable immunological conclusions without writing each analysis from scratch.

Core Features & Use Cases

  • Diversity & Clonality Metrics: Computes Shannon entropy, Simpson index, Gini coefficient, clonality, and rarefaction curves to assess repertoire complexity and sequencing depth.
  • Clonal Expansion & Tracking: Detects expanded clonotypes above frequency thresholds, identifies convergent recombination and public clones, and tracks clonotypes longitudinally across timepoints.
  • Epitope Specificity Prediction: Queries IEDB, BVBRC, VDJdb, and PubMed through ToolUniverse tools to link expanded CDR3 sequences to known antigens.
  • Single-Cell Integration: Maps TCR/BCR clonotypes onto single-cell RNA-seq phenotypes to associate expanded clones with cell clusters and differential expression.
  • Use Case: Compare a cancer patient's TCR repertoire before and after immunotherapy to find newly expanded clonotypes, then query IEDB to determine whether those clones match known tumor or viral epitopes.

Quick Start

Load my MiXCR clonotype file, calculate diversity metrics, detect expanded clones, and check the top clones against IEDB for known epitope matches.

Frequently Asked Questions about tooluniverse-immune-repertoire-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze TCR repertoire sequencing data in Python?

Load AIRR-seq data from MiXCR, ImmunoSEQ, AIRR, or 10x formats into a standardized clonotype table, then define clonotypes by V gene, J gene, and CDR3 amino acid sequence. From there compute diversity metrics, detect expanded clones, and query epitope databases for specificity.

How to calculate TCR repertoire diversity and clonality?

Compute Shannon entropy, Simpson index, inverse Simpson, Gini coefficient, and clonality (1 minus Pielou's evenness) from clonotype count distributions. Clonality above 0.2 indicates moderate clonal dominance; above 0.5 suggests strong oligoclonal expansion.

What file formats does immune repertoire analysis support?

The workflow supports MiXCR tab-separated output, Adaptive Biotechnologies ImmunoSEQ, the AIRR Community standard rearrangement format, and 10x Genomics VDJ filtered contig annotations. Each loader normalizes columns to cloneId, count, frequency, cdr3aa, cdr3nt, v_gene, j_gene, and chain.

Can I integrate TCR clonotypes with single-cell RNA-seq data?

Yes, 10x VDJ contig annotations can be mapped to single-cell gene expression AnnData objects by cell barcode. This enables identifying expanded clonotype phenotypes on UMAP, clonotype-cluster associations, and differential expression between expanded and non-expanded cells.

Why does my repertoire show very low diversity with few dominant clones?

Low diversity may reflect genuine antigen-driven clonal expansion, as in active infection or tumor-infiltrating lymphocytes, or technical PCR amplification bias. Check sequencing QC, generate rarefaction curves to confirm adequate depth, and compare against healthy donor reference distributions.

How much sequencing depth is needed for bulk TCR-seq analysis?

A minimum of 50,000 to 100,000 total reads is recommended for bulk TCR-seq, with 10,000 or more unique UMIs per sample. Rarefaction curves that plateau indicate sufficient depth; a still-rising curve means diversity estimates are underestimates.