vdjtools

Analyzes TCR/BCR immune repertoires on the AIRR schema using Python, polars, and a native C++ engine.

145|42|Updated Jun 6, 2014
One-click install
npx skills add https://github.com/antigenomics/vdjtools --skill vdjtools-antigenomics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vdjtools
Source: https://github.com/antigenomics/vdjtools/tree/main/skills/vdjtools
Command: npx skills add https://github.com/antigenomics/vdjtools --skill vdjtools-antigenomics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires polars, arda, vdjmatch, seqtree.

What problem does it solve? Immune-repertoire analysis requires ingesting many incompatible sequencer output formats, computing generation probabilities, diversity statistics, clonotype overlap, and longitudinal dynamics, which is error-prone when done with ad-hoc scripts. ## Core Features & Use Cases - Format ingestion and normalization: Read MiXcr, MiGec, immunoSEQ, IMGT/HighV-QUEST, Vidjil, RTCR, TRUST4, and AIRR files into one canonical AIRR-schema clonotype frame built on polars. - V(D)J recombination modeling: Compute Pgen for nucleotide and amino-acid junctions, infer models via EM from your own germline references, generate synthetic repertoires, and compare models with JSD-based metrics. - Cohort analytics: Run diversity statistics, rarefaction, segment usage, spectratype, overlap/TCRnet, biomarker association testing, longitudinal clonotype tracking, and single-cell pairing with scirpy/dandelion interop. - Use Case: Given a cohort of MiXcr output files from vaccinated donors, convert them to the canonical schema, then run the paired expansion test and VDJtrack recapture model to identify significantly expanding clonotypes across timepoints. ## Quick Start Ask the assistant to use the vdjtools skill to read your MiXcr output files and compute cohort-wide diversity statistics.

Frequently Asked Questions about vdjtools

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

FAQPage Schema
How do I compute Pgen for a CDR3 amino acid sequence?

Load a bundled model with vdjtools.model.load_bundled(locus) and call pgen_aa(model, sequence), optionally pinning V/J calls or allowing one mismatch. For many sequences, pgen_aa_batch runs thread-parallel with bitwise-identical results to the serial version.

How to convert MiXcr or immunoSEQ files to AIRR format?

Use vdjtools.io.read with fmt="auto" to sniff the format, or call read_mixcr, read_immunoseq, read_imgt, or read_trust4 directly. Every reader emits the same canonical clonotype frame with junction_nt and junction_aa columns following the AIRR junction convention.

Can vdjtools build a recombination model from a custom germline?

Yes, model.from_germline builds a model from any germline DataFrame with allele, segment, and sequence columns, and reference.read_germline_fasta constructs that frame from your own FASTA files. reference.validate_germline audits anchor frames and naming before training.

Does vdjtools support single-cell VDJ data from 10x CellRanger?

Yes, vdjtools.sc.read_airr_cell reads CellRanger airr_rearrangement.tsv files and read_10x handles contig annotation CSVs across CellRanger versions 3 through 7. It also exports to scirpy, dandelion, and scRepertoire formats for downstream single-cell analysis.

Why does generate() give different results with the same seed?

Before version 3.3.0, collapse_alleles used an unordered polars group_by, so the collapsed table row order varied per process and the same seed drew different alleles. Seeds are reproducible across processes only from version 3.3.0 onward.

What are the limitations of amino-acid level Pgen scoring?

Amino-acid Pgen is a relative score only and is not normalized, so model_fit uses nucleotide Pgen for likelihood, AIC, and BIC. Also, the character X means wildcard only in pgen_aa_degenerate; in pgen_aa it matches literally and silently returns 0.0.