bio-workflows-tcr-pipeline
$
npx mdskill add GPTomics/bioSkills/bio-workflows-tcr-pipelineAnalyzes TCR/BCR repertoire data from FASTQ to clonotype diversity metrics using MiXCR and VDJtools
- Processes immune repertoire sequencing data from raw FASTQ files to diversity metrics
- Relies on MiXCR for alignment and clonotype assembly, VDJtools for diversity analysis
- Follows a predefined pipeline workflow with configurable parameters for bulk or single-cell data
- Exports clonotype data and diversity statistics for downstream visualization and interpretation
SKILL.md
.github/skills/bio-workflows-tcr-pipelineView on GitHub ↗
---
name: bio-workflows-tcr-pipeline
description: End-to-end TCR/BCR repertoire analysis from FASTQ to clonotype diversity metrics. Use when analyzing immune repertoire sequencing data from bulk or single-cell experiments.
tool_type: cli
primary_tool: MiXCR
---
## Version Compatibility
Reference examples tested with: MiXCR 4.6+, VDJtools 1.2.1+
Before using code patterns, verify installed versions match. If versions differ:
- CLI: `<tool> --version` then `<tool> --help` to confirm flags
If code throws ImportError, AttributeError, or TypeError, introspect the installed
package and adapt the example to match the actual API rather than retrying.
# TCR/BCR Analysis Pipeline
**"Analyze my TCR/BCR repertoire sequencing data end-to-end"** → Orchestrate MiXCR clonotype extraction, VDJtools diversity/repertoire analysis, Immcantation SHM and lineage analysis, and visualization of V/J gene usage and clonal dynamics.
## Pipeline Overview
```
FASTQ → MiXCR align → Assemble → Export → VDJtools diversity → Visualization
```
## Step 1: MiXCR Processing
```bash
# Align reads to V(D)J segments
mixcr align -s hsa -p rna-seq \
R1.fastq.gz R2.fastq.gz \
aligned.vdjca
# Assemble clonotypes
mixcr assemble aligned.vdjca clones.clns
# Export
mixcr exportClones clones.clns clones.txt
```
## Step 2: VDJtools Analysis
```bash
# Convert to VDJtools format
vdjtools Convert -S mixcr clones.txt vdjtools/
# Diversity metrics
vdjtools CalcDiversityStats vdjtools/clones.txt diversity/
# Sample overlap
vdjtools CalcPairwiseDistances vdjtools/*.txt overlap/
```
## Step 3: Visualization
```bash
# Spectratype plot
vdjtools PlotFancySpectratype vdjtools/clones.txt spectra/
# V usage
vdjtools PlotFancyVJUsage vdjtools/clones.txt usage/
```
## QC Checkpoints
1. **After alignment**: Check V/J assignment rate (>70% typical)
2. **After assembly**: Verify clonotype count and coverage
3. **After diversity**: Compare metrics to expected range
## Related Skills
- tcr-bcr-analysis/mixcr-analysis - Detailed MiXCR usage
- tcr-bcr-analysis/vdjtools-analysis - Diversity metrics
- tcr-bcr-analysis/repertoire-visualization - Plots
More from GPTomics/bioSkills
- bio-admet-predictionPredicts ADMET properties using ADMETlab 3.0 API or DeepChem models. Estimates bioavailability, CYP inhibition, hERG liability, and 119 toxicity endpoints with uncertainty quantification. Filters for PAINS and other structural alerts. Use when filtering compounds for drug-likeness or prioritizing leads by predicted safety.
- bio-alignment-amplicon-clippingTrim PCR primers from aligned reads in amplicon-panel BAMs using samtools ampliconclip. Use when processing SARS-CoV-2 ARTIC, hereditary cancer panels, ctDNA hot-spot panels, or any amplicon assay where primer-derived bases would falsely confirm reference at primer footprints.
- bio-alignment-filteringFilter alignments by flags, mapping quality, and regions using samtools view and pysam. Use when extracting specific reads, removing low-quality alignments, or subsetting to target regions.
- bio-alignment-indexingCreate and use BAI/CSI indices for BAM/CRAM files using samtools and pysam. Use when enabling random access to alignment files or fetching specific genomic regions.
- bio-alignment-ioRead, write, and convert multiple sequence alignment files using Biopython Bio.AlignIO. Supports Clustal, PHYLIP, Stockholm, FASTA, Nexus, and other alignment formats for phylogenetics and conservation analysis. Use when reading, writing, or converting alignment file formats.
- bio-alignment-msa-parsingParse and analyze multiple sequence alignments using Biopython. Extract sequences, identify conserved regions, analyze gaps, work with annotations, and manipulate alignment data for downstream analysis. Use when parsing or manipulating multiple sequence alignments.
- bio-alignment-msa-statisticsCalculate alignment statistics including sequence identity, conservation scores, substitution matrices, and similarity metrics. Use when comparing alignment quality, measuring sequence divergence, and analyzing evolutionary patterns.
- bio-alignment-multiplePerform multiple sequence alignment using MAFFT, MUSCLE5, ClustalOmega, or T-Coffee. Guides tool and algorithm selection based on dataset size, sequence divergence, and downstream application. Use when aligning three or more homologous sequences for phylogenetics, conservation analysis, or evolutionary studies.
- bio-alignment-pairwisePerform pairwise sequence alignment using Biopython Bio.Align.PairwiseAligner. Use when comparing two sequences, finding optimal alignments, scoring similarity, and identifying local or global matches between DNA, RNA, or protein sequences.
- bio-alignment-sortingSort alignment files by coordinate or read name using samtools and pysam. Use when preparing BAM files for indexing, variant calling, or paired-end analysis.