VDJtools performs standardized post-analysis of TCR/BCR clonotype tables (from MiXCR and other RepSeq pipelines): diversity, clonality, overlap, segment usage, spectratype, and longitudinal tracking. The dominant analytical fact is that a repertoire is a depth-limited sample of an enormous clonal population, so nearly every metric -- richness, Shannon, clonality, Jaccard, shared counts -- is confounded by sequencing depth and by library chemistry. Samples must be brought to a common depth (DownSample, or the resampled CalcDiversityStats table / rarefaction curves) before any cross-sample claim, diversity should be read as a Hill profile rather than one index, overlap should use depth-robust metrics (Morisita-Horn, F2) with a fixed clonotype match key, and public clonotypes reflect generation probability more than antigen selection. immunarch is the actively maintained R alternative that consumes the same tables.
# VDJtools (fat JAR, needs Java 8+)
wget https://github.com/mikessh/vdjtools/releases/download/1.2.1/vdjtools-1.2.1.zip
unzip vdjtools-1.2.1.zip
java -version
# One-time: install the R packages the Plot* modules call
java -jar vdjtools-1.2.1/vdjtools-1.2.1.jar RInstall
# Optional modern R alternative
Rscript -e "install.packages('immunarch')"
Tell your AI agent what you want to do: - "Downsample my repertoires to equal depth, then compare diversity" - "Report a Hill diversity profile (q=0, q=1, q=2) per sample" - "Compute Morisita-Horn overlap between conditions on nucleotide clonotypes" - "Make a spectratype and V-J usage plot for each sample" - "Track clonotypes across timepoints and flag expansions"
"Bring all samples to a common read depth and compare observed diversity, exp-Shannon and inverse Simpson between responders and non-responders."
"Draw rarefaction curves so I can see whether the diversity difference survives at equal depth."
"Summarize clonality per sample, but pair it with inverse Simpson so it is not misleading."
"Compute pairwise Morisita-Horn overlap on amino-acid clonotypes and cluster the samples."
"Find clonotypes shared between pre- and post-treatment, using nucleotide identity with V and J matching."
"Which public clonotypes are shared across patients, and how should I interpret them given generation probability?"
"Plot the CDR3-length spectratype and tell me whether it looks polyclonal or skewed."
"Compare V-gene usage across samples, accounting for possible primer bias."
"Track the top clonotypes across the vaccination time course and identify expansions."
.resampled.txt table or DownSample first. Raw comparison across unequal depth is the most common invalidating error.-i) constant across a study and state it in every figure; aa keys inflate sharing via convergent recombination.java -Xmx8g -jar vdjtools.jar ....