@@ -27,12 +27,13 @@ Built on the antigenomics ecosystem:
2727[ vdjmatch] ( https://github.com/antigenomics/vdjmatch ) (overlap + TCRnet),
2828[ arda] ( https://github.com/antigenomics/arda ) (AIRR annotation + markup repair).
2929
30- > ** Status: ` v2.2.0 ` ** — the native V(D)J model engine plus the full analytics suite (diversity,
31- > overlap/TCRnet, preprocessing, biomarkers, single-cell), CDR features, and legacy-format ingestion
32- > (MiXcr, MiGec, immunoSEQ, IMGT/HighV-QUEST, Vidjil, RTCR, TRUST4, arda). Clonotype columns follow the AIRR
33- > ** junction** convention (` junction_nt ` / ` junction_aa ` ). The legacy v1.x tool lives on the
34- > [ ` legacy-1.x ` ] ( https://github.com/antigenomics/vdjtools/tree/legacy-1.x ) branch and its releases
35- > remain available under the repository tags (` v0.0.1 ` … ` 1.2.1 ` ).
30+ > ** Status: ` v3.0.0 ` ** — the native V(D)J model engine plus the full analytics suite (diversity,
31+ > overlap/TCRnet, preprocessing, biomarkers, single-cell), ** longitudinal clonotype dynamics**
32+ > (paired expansion testing + the VDJtrack recapture model), CDR features, and legacy-format
33+ > ingestion (MiXcr, MiGec, immunoSEQ, IMGT/HighV-QUEST, Vidjil, RTCR, TRUST4, arda). Clonotype
34+ > columns follow the AIRR ** junction** convention (` junction_nt ` / ` junction_aa ` ). The legacy v1.x
35+ > tool lives on the [ ` legacy-1.x ` ] ( https://github.com/antigenomics/vdjtools/tree/legacy-1.x ) branch
36+ > and its releases remain available under the repository tags (` v0.0.1 ` … ` 1.2.1 ` ).
3637
3738## Install
3839
@@ -71,16 +72,23 @@ for germline lookup, Pgen, generation, or the analytics. Install it via conda/br
7172
7273### Development
7374
75+ Uses [ uv] ( https://docs.astral.sh/uv/ ) — one repo-local ` .venv ` , no conda:
76+
7477``` bash
75- conda env create -f environment.yml # python + C++ toolchain + mmseqs2 (arda's aligner)
76- conda activate vdjtools
77- pip install -e " .[dev,test]" # builds the _core C++ extension
78+ uv venv && source .venv/bin/activate
79+ uv pip install -e " .[dev,test]" # builds the _core C++ extension (scikit-build-core)
7880```
7981
80- The conda env is a convenience, not a requirement — ` pip install -e ".[dev,test]" ` in any venv
81- works. It supplies MMseqs2 so the slow arda annotation round-trips in the test suite run too.
82+ Or run the bootstrap script (portable across bash/zsh, uv-first with a ` python -m venv ` fallback):
83+
84+ ``` bash
85+ bash setup.sh --dev-parents --tests # or: zsh setup.sh
86+ ```
8287
83- Or run the bootstrap script: ` bash setup.sh --dev-parents --tests ` .
88+ You need a C++ toolchain (Xcode CLT on macOS, build-essential on Linux) for the native ` _core `
89+ extension. MMseqs2 is arda's aligner, needed ** only** for the annotation path and the slow arda
90+ round-trip tests — ` brew install mmseqs2 ` , or use the optional ` environment.yml ` conda env which
91+ bundles it.
8492
8593## Quickstart — recombination model engine
8694
@@ -130,15 +138,28 @@ vdjtools generate -m TRB -n 1000 -o gen.tsv # sample sequences (cf. olga-ge
130138vdjtools pgen seqs.tsv -m TRB -o pgen.tsv # Pgen per CDR3 (cf. olga-compute_pgen)
131139vdjtools pgen seqs.tsv -m TRB --mismatches 1 # + the Hamming-1 ball; --v-col/--j-col to condition
132140
141+ # data — convert any format to the canonical table (TSV, or Parquet by extension), preprocess
142+ vdjtools convert mixcr.txt.gz -o clones.parquet # MiXcr/immunoSEQ/AIRR/… → canonical Parquet
143+ vdjtools downsample clones.parquet 100000 -o ds.tsv
144+ vdjtools filter clones.parquet --coding --min-freq 1e-4 -o coding.tsv
145+ vdjtools pool s1.tsv s2.tsv s3.tsv --join --min-samples 2 -o joint.tsv
146+
133147# repertoire analytics — sample files, or a cohort via -m/--metadata + --base-dir
134148vdjtools diversity sampleA.tsv sampleB.tsv -o diversity.tsv
135149vdjtools overlap * .tsv -o overlap.tsv
136150vdjtools segment-usage * .tsv --segment v -o usage.tsv
137151vdjtools spectratype * .tsv -o spectra.tsv
152+ vdjtools diversity -m metadata.txt --base-dir samples/ --threads 8 -o div.tsv # parallel cohort
153+ vdjtools spectratype --cohort cohort_parquet/ -o spectra.tsv # one streamed pass
154+
155+ # longitudinal — paired within-donor expansion test between two timepoints
156+ vdjtools dynamics day0.tsv day15.tsv -o tracked.tsv
138157```
139158
140- Native vdjtools and AIRR Rearrangement inputs are auto-detected; every command writes TSV to ` -o `
141- (or stdout, so it pipes). Run ` vdjtools <command> --help ` for options.
159+ Native vdjtools, AIRR Rearrangement, Parquet, and third-party inputs are auto-detected; every
160+ command writes to ` -o ` — ** TSV, or Parquet when the path ends in ` .parquet ` / ` .pq ` ** — or to stdout
161+ (so it pipes). Cohort commands parallelise over samples with ` -t/--threads ` or stream a pre-ingested
162+ Parquet cohort with ` --cohort ` . Run ` vdjtools <command> --help ` for options.
142163
143164## Analytics (Python API)
144165
@@ -175,6 +196,22 @@ usage = preprocess.correct_vj_usage(cohort, batch_col="batch", transform="sigmoi
175196fixed = preprocess.apply_vj_correction(sampleA, usage, sample_id = " A0" )
176197```
177198
199+ Longitudinal tracking — which clonotypes changed between two timepoints, and the VDJtrack recapture
200+ model (Pavlova, Zvyagin & Shugay 2024):
201+
202+ ``` python
203+ from vdjtools import dynamics
204+
205+ # paired within-donor test: emergent / expanded / persistent / contracted / vanishing
206+ tracked = dynamics.test_pair(day0, day15) # depth handled per-pair (effective N)
207+ grouped = dynamics.test_metaclonotypes(day0, day15, scope = " 1,0,0,1" ) # 1-Hamming CDR3 ball first
208+ called = dynamics.expansion_test(day0, day15) # edgeR NB-exact caller (log2FC + p)
209+
210+ # VDJtrack size-bucket recapture model — recapture fraction per clone-size class (Beta bands);
211+ # split by a group column + capture_test() for the group effect (see notebooks/vaccination_tracking.py)
212+ rates = dynamics.capture_rates(pre, post)
213+ ```
214+
178215Incidence-based clonotype association (Emerson 2017 / Howie 2015 / De Witt 2018 / Vlasova 2026)
179216— a choice of test, condition, and co-occurrence — and single-cell paired-chain Pgen:
180217
@@ -232,7 +269,12 @@ suites (`RUN_BENCHMARK=1`).
232269- ** Overlap** — sample overlap and TCRnet (via vdjmatch/seqtree), similarity-aware overlap, clustering.
233270- ** Preprocess** — downsampling, error-correction, VJ-usage batch-effect correction, pooling/joining.
234271- ** Biomarker** — incidence association (Fisher / χ² / Bayesian / permutation) vs binary / HLA-allele / CMH-stratified conditions; α-β & same-chain co-occurrence pairing; metaclonotypes.
235- - ** Single-cell** — AIRR Cell / 10x interoperability, chain pairing + QC, and paired α/β Pgen.
272+ - ** Dynamics** — longitudinal clonotype tracking between timepoints: the paired within-donor
273+ expansion test (emergent / expanded / persistent / contracted / vanishing), the VDJtrack
274+ size-bucket ** recapture model** , metaclonotype-grouped testing, and an edgeR NB-exact caller
275+ ([ ` vdjtools.dynamics ` ] ( python/vdjtools/dynamics ) ).
276+ - ** Single-cell** — AIRR Cell / 10x interoperability, chain pairing + QC, paired α/β Pgen, and a
277+ ` to_anndata ` bridge into the scverse ecosystem (writes ` .h5ad ` / ` .zarr ` via AnnData).
236278
237279## License
238280
0 commit comments