Build and release#
Use build integrity for candidate validation, CI artifact checks and promotion from one release to the next.
The build is a uv-managed Python package. It reads chunks/, patches/ and proofreading/, and
combines them with the committed identity registry and explicitly selected reference inputs.
Every requested build stage recomputes its outputs; computed intermediates are not reused
between database builds.
Local build#
uv sync --extra motifs --extra confidence --extra summary --extra test
uv run vdjdb qc # chunk validation, fail-fast
uv run vdjdb build --out out/ # the definitive tables, then every projection
uv run vdjdb make legacy --tables out/tables # the legacy files, from the tables that shipped
uv run vdjdb convert airr --tables out/tables # AIRR Rearrangement, Receptor and Reactivity
uv run vdjdb motifs --tables out/tables # TCRNET + TCREMP
uv run vdjdb score-records --tables out/tables # frozen record confidence v3
uv run vdjdb summary --legacy out/legacy # the dashboard, rendered offline and checked
uv run vdjdb identity check --tables out/tables # the identifier invariants
uv run vdjdb corpus build --tables out/tables # the reference corpus: tf-idf over 13 token families
uv run vdjdb diff reference.zip out/legacy # compare against a released zip
uv run vdjdb release --tag YYYY-MM-DD --dry-run # write bundles without updating the tracked pointer
VDJDB_REFERENCE_ZIP=reference.zip uv run pytest -q
Output goes to out/, not build/: build/ is gitignored as a Python packaging convention.
build already writes legacy and AIRR projections by default; the make and convert commands
above show how to regenerate them from explicitly selected definitive tables, rather than steps
that need repeating in every build. For a compact primary-only build, pass --no-legacy --no-airr.
The README lists the same optional projection commands.
See build directories and storage for the exact files
and structure cross-links for the
separate coordinate dataset and its current record IDs.
The hosted build.yml workflow fetches the structure metadata separately from dataset revision
337b7e4336ef4c8cd12a4173b4fdce331d9b2a35 and verifies SHA256
86bbfefd3a59229842504da546bef16e41de366db7ee0d08d339c6e2904fc409 before passing
--structure-metadata out/inputs/vdjdb_structures_metadata.tsv.gz to assembly. Local builds
include those external evidence rows only when the same option is supplied. Assembly does not
download structures or metadata. Updating this reviewed input is an explicit workflow change;
the hosted build does not follow a moving dataset branch.
Optional vdjdb build --structure-supplemental <metadata.tsv.gz> merges reviewed additional
raw model metadata within that build. It is off unless supplied. The hosted assembly and scoring
currently omit it pending matched-cohort extraction validation. The raw supplemental catalogue
keeps reported assignments separate from synthetic swapped pairs and mutants; depositing a
coordinate or a record link does not establish an experimental assignment. Public deposits
contain no assay outcomes.
After motifs, vdjdb score-records --tables out/tables loads the packaged frozen v3.2 models
and writes record_scores.parquet and record_scores.tsv.gz, one row per current record_id.
Use --model <model.json> for an explicit frozen model and --out <directory> for another
output directory. Scoring recomputes features and predictions from the completed tables;
it does not fit a model or change the legacy score. The outputs include assay-validation probability
(v3.2a) and independent-study validation probability (v3.2b), each with its own model identity.
V3.2a uses fixed epitope contexts and separated continuous producer indices while preserving hard
memberships. Its reported comparisons use the fitted cohort. See
record confidence v3.2a/v3.2b for interpretation and standalone fitting.
--legacy-v31 selects v3.1; --legacy-v3 selects original v3. In those legacy modes only,
--soft-membership selects exploratory Hamming-1 fractions with integer member/neighbour counts.
The hosted full build requires both outputs and checks their record IDs against records.parquet.
The independent structure-file audit verifies the checksum-pinned raw inputs declared in
proofreading/structure_inputs.tsv and streams every declared archive. Its fetch step stages
raw inputs, not computed results. Check the current manifest sizes and free space before fetching:
uv run python processing/proofread_structure_files.py --structures out/inputs/structures \
--tables out/tables --out out/reports/structures --fetch
Omit --fetch to verify an existing local input mirror. The audit checks current model links
against reviewed coordinate-sequence metadata and checks coverage of every native accession.
It streams and hash-checks the coordinate files; it does not independently re-extract their chains. It keeps sequence matches distinct from
historical lineage associations, writes compact Parquet/JSON reports, and changes no chunk.
The hosted build runs it separately from assembly and uploads the reports in build-reports.
Supplemental archives and current links are audited separately even while their metadata remains
disabled in default assembly and scoring.
See structure cross-links for their meaning.
vdjdb release writes tracked latest-version.txt. Use --dry-run to write and inspect bundles without
changing the repository’s tracked download URL. It still stages files and writes archives,
checksums and lifecycle outputs; it is not a read-only operation. Supply an intended release tag when publishing.
Download the 2026-06-03 release as reference.zip before running the comparison or release tests.
A plain pytest -q skips the reference checks when VDJDB_REFERENCE_ZIP is unset. See
dashboard requirements for R and pandoc installation.
Optional dependency groups: motifs for the motif stage, confidence for post-assembly record
scoring, docs for this site, test for the
suite, tuning for the clustering bake-off under docs/tuning/.
Choose the scope of a check#
Use the smallest stage that answers the current question. Every invocation recomputes its results; partial assessment is not a stored intermediate for a later release build.
Question |
Command or workflow |
What it establishes |
|---|---|---|
Is this chunk well formed? |
|
Source validation for the selected files |
What does it contribute? |
|
Corpus-relative scores, novelty and source-review reports, before expensive downstream annotation |
What does mhcmatch predict for these reported peptides? |
|
Selected-pair assessment, independent of junction inference, motifs and dashboard |
Recompute assessment for a built corpus |
|
Fresh assessment from the records table, without reading previous predictions |
Re-emit a format |
|
A projection from the explicitly selected built tables |
Score completed records |
|
Fresh v3 predictions from completed motif and structural evidence with a frozen model |
Audit coordinate files |
|
Raw archive integrity, current model-link sequence flags and all native-accession coverage |
Assess corpus-wide consequences and integrate |
|
Full assembly, corpus, motifs, record scoring, structural audit, dashboard, release comparison and release tests |
For selected-chunk predictions:
uv run vdjdb epitope-reference --out out/inputs
uv run vdjdb assess-epitopes chunks/PMID_<id>.tsv --out out/assessment \
--pmhc-reference out/inputs/pmhc/pmhc_full.tsv.gz --jobs 4
This writes only epitope_assessment.parquet, epitope_assessment.tsv.gz and
assessment-timings.tsv. Without a reference, reported pairs remain visible with
reference_not_supplied. Files are harmonised and deduplicated through the existing master
assembly; support counts describe the selected input only. For corpus-relative scores and
cross-publication checks, use submission, which reads the complete source corpus. Neither
partial command writes the identity registry. A subset is not a release bundle.
The opt-in assessment.yml workflow takes whitespace-separated tracked chunks/ paths from
the chosen revision and a predict switch. It runs selected QC, the corpus-relative submission
report and the standalone assessment on a hosted runner, uploading one assessment artifact.
It does not run motifs, junction-nucleotide inference, R or the release comparison. Keep ordinary
chunk-check CI fast; request this additional workflow when a peptide/MHC question needs it.
The existing chunk-check.yml manual entry point also accepts assessment_chunks and
assessment_predict, calling the same workflow as an additional job. Ordinary pull requests
leave it disabled. To exercise it on a feature revision:
gh workflow run chunk-check.yml --ref <branch> \
-f assessment_chunks=chunks/PMID_<id>.tsv -f assessment_predict=true
Presentation calibration still has a fixed per-species/class setup cost for small submissions.
With mhcmatch 1.20.2, the full-corpus assessment measured 198.3 seconds on four hosted CI
cores, 51.4% of timed assembly, with a sampled process-tree peak of 3,365.6 MiB. The previous
1.20.0 profile took 861.0 seconds / 82.4% of assembly. These are assembly shares, not shares of
the complete workflow. Locally, four single-thread workers took 83.2 seconds against the earlier
262.8-second workaround on the same host, with a 2,317.2 MiB sampled process-tree peak.
Serial output is identical. Assessment timing records
peak_tree_rss_mb, the aggregate RSS of parent and descendants sampled every 50 milliseconds.
The assembly gate separately budgets this at 8,192 MiB, based on the measured 4,931.4 MiB cold
process-tree peak, while keeping its 4,096 MiB parent budget. Unmeasured tree peaks are blank.
Published mhcmatch 1.20.2 resolves mhcmatch #4.
Assessment reads the reference and constructs one scorer per species/class worker slice, calls
score_many once per allele, and clears calibration distributions through the public API between
alleles. The per-allele scorer reconstruction workaround is removed. Sorted class-II alleles
still use contiguous worker slices; global best flags use unrounded ranks and an allele-name
tiebreak. Matched-length calibration, fixed seeds and disabled persistence are unchanged. Native numerical
threads are capped before scorer imports in serial and parallel mode, including already loaded
caller libraries; the caller’s thread settings are restored afterward.
Read the standalone timing report for a selected
submission instead of extrapolating that ratio. Full integration must still recompute non-additive
outputs such as clustering, motifs and corpus-wide statistics from the combined corpus.
Comparing against a release#
vdjdb diff compares a candidate build against a released bundle in three passes: the file set,
two digests per file (raw and canonical, rows sorted), and a row-level classification that
attributes every changed cell to a declared rule in rules/expected_diffs.toml.
Any cell difference not matched by a rule fails, and so does a rule that fires a different number of times than declared. Every rule therefore declares a measured row count rather than a description.
A correction to an identity column has no cell to attribute: the row leaves the reference bucket and a
different row arrives in the candidate one. Those two counts are declared per file in a [[row_delta]]
block, with a note giving every reason they are what they are, and the run fails if either moves. A
new chunk moves all of them, because its records are rows the reference cannot contain, so landing one
means re-measuring the three declarations and extending each note with the chunk and its record count -
the entry for PMID_18025130 is the worked example. vdjdb diff --report prints declared against
measured per file and flags which one moved.
What the comparison is, and is not, the instrument for#
It runs on the assembled legacy zip, so the thing compared is the file a consumer downloads.
Four of that bundle’s twelve members cannot be judged by keying their rows against the reference,
and [measured_elsewhere] in rules/expected_diffs.toml names each one with the instrument that
gates it instead. They are still read, digested, row-counted and printed; what they are exempt from
is the requirement that every changed cell match a rule.
Member |
Why keying it says nothing |
What gates it |
|---|---|---|
|
|
|
|
a row is one PWM cell of one cluster, so it has no identity that survives a re-clustering |
the same two |
|
a fresh render every build |
|
|
not a table |
shipped verbatim from the repository root |
Measured before those declarations existed: comparing every member of the legacy zip reported 101,877
unattributed cells, and every one was in a motif file or in latest-version.txt while the five
legacy tables were fully attributed. The workflow’s answer had been --only naming those five, which
is the same exemption with no reason recorded and no digest taken of the other seven.
A member the reference does not contain is declared in [members]. Today that is
cluster_members_tcremp.txt and motif_pwms_tcremp.txt; an undeclared one still fails.
Canonical equality is the gate; raw equality is informational. The legacy pipeline iterated
os.listdir("../chunks"), which is readdir order and therefore filesystem- and host-dependent, so
the 2026-06-03 release cannot be reproduced byte-for-byte on another machine, including by the
pipeline that produced it. The current reader sorts, and a release records its chunk order, so raw
equality is achievable for releases built by this code.
Testing against older releases#
The comparison currently runs one build against one release, 2026-06-03. A single release cannot distinguish a rule that is correct from a rule that happens to fit that release.
The historical inventory contained 43 published releases, back to 2017-06-13.
A replay pairs each release’s inputs and outputs: the inputs
(chunks/, patches/, proofreading/ at that tag, and res/ for a tag older than the #658
retirement) and the outputs (the zip that shipped).
A replay is a separate, explicitly requested regression experiment. Select the historical
input tree and current executable explicitly, then use era-scoped comparison rules:
git worktree add /tmp/vdjdb-2023 2023-06-01 # the corpus as it was
cd /tmp/vdjdb-2023
/path/to/current/repo/.venv/bin/vdjdb build --out out/
/path/to/current/repo/.venv/bin/vdjdb diff /path/to/2023-06-01.zip out/legacy
What a replay across releases adds:
Code changes separated from corpus changes. Every rule in
expected_diffs.tomlis currently declared against one release. A rule that fires the same way across 2021, 2023 and 2026 is a property of the code; one that fires only on 2026 is a property of today’s data.Format drift that the current corpus no longer contains. The 2017–2019 chunks use header shapes, MHC spellings and nomenclature that later curation cleaned up, and those are the inputs a reader of an old release would hand back to the tool.
Dates for known defects.
web.cdr3fix.unmpwas wrong on 7,973 rows in the recorded comparison; replaying it across releases says when it started.
Older releases were produced by older code with different column sets, so the comparison needs
era-scoped rules rather than one global set: vdjdb.txt gained columns, the slim table changed
shape, and the motif files did not exist at all before 2018. The first replay therefore produces a
large diff that is mostly format difference, and the work is in classifying it.
For an authorized replay, start with one release, 2023-06-01: recent enough to share most of the schema, old enough that a rule which only fits 2026 will not fit it.
Protect integration and release branches#
The repository has delete_branch_on_merge enabled, which is right for feature branches and wrong for
the long-lived ones: a dev to master pull request has dev as its head, so merging it used to
delete dev. That happened on PR #573 and again on PR #584. Nothing was lost except the ref - every
commit stays reachable from master - but a contributor pulling in the window between the merge and the
restore gets a confusing error, and the symptom does not look like a branch-protection question.
It is fixed by a ruleset rather than by turning the setting off, so feature branches still tidy themselves up:
Ruleset |
Refs |
Rules |
Bypass actors |
|---|---|---|---|
|
|
|
none |
|
|
|
org admin, admin, triage |
|
the default branch |
|
org admin |
⚠ The bypass list is why protect-dev alone did not work. It already carried a deletion rule, but
a merge runs as the person merging, and an admin’s always bypass covers the deletion too. A GitHub
ruleset’s bypass list applies to the whole ruleset and cannot be set per rule, so the deletion rule needs
its own ruleset with an empty bypass list. That is what no-deletion-dev-master is, and it holds: a
git push origin --delete dev from an admin is now rejected with GH013.
protect-dev keeps its bypass on purpose, so a maintainer can still push a fix to dev directly when a
status check is stuck. Deletion is the only thing nobody may do.
If dev is ever absent again, identify the exact dev-to-master merge first. Its second parent is the dev tip
at that merge; do not assume the current master tip is still that merge:
merge_commit=FULL_SHA_OF_VERIFIED_DEV_TO_MASTER_MERGE
git push origin "${merge_commit}^2:refs/heads/dev"
Reproducibility#
Same inputs, same bytes: in another process, on another host, at another core count.
One seed,
vdjdb.config.SEED, passed explicitly to every sampler, shuffler and clustering init. No module-scoperandom.seed(), no unseeded default.Sort after anything unordered: a
group_bywithoutmaintain_order=True, aset, adictkeyed on strings underPYTHONHASHSEED, a thread pool,os.listdir. An unstable sort over equal-labelled groups once made the release comparison report three different changed-row counts for one comparison.Worker count never changes the answer. Split into as many big contiguous slices as there are workers, reassemble in slice order, never a pool of small tasks.
Committed inputs#
The following reviewed inputs support offline, deterministic builds and documented comparisons. All are committed, reviewed inputs, refreshed by their own pull request and never written by a build:
summary/reference_years.tsv- the publication year of every reference, so the dashboard does not call NCBI while it renders. Rebuilt byuv run vdjdb refs.docs/tuning/scorecard.tsv- the clustering bake-off, 252 configurations scored through one harness. Rebuilt bydocs/tuning/sweeps.py.proofreading/epitope_promiscuity.tsv- which class I alleles can present each epitope, 13,510 (epitope, allele) pairs over 1,729 epitopes, of which 1,739 are pairings recorded in VDJdb and 11,771 are additional predicted peptide–allele pairings. Rebuilt byuv run vdjdb promiscuity, which loadsmhcmatch’s reference panel from HuggingFace. It answers a query-side question - filter VDJdb to a donor’s HLA type and see every record their T cells could have raised - and makes no claim about themhc.aa publication reported.
None of these tables is a cache: a cache is a stored answer to the question the build is currently asking, and these are inputs that arrive by review.
Legacy web co-deliverable#
vdjdb make web --tables out/tables --out out/web projects the 27-column
legacy web table and matching metadata from the rich tables. The ordinary legacy
export remains 22 columns. vdjdb release --tag TAG --with-web additionally packages
vdjdb-web-VERSION.zip with both motif methods, static scatter charts and the summary;
existing release bundles are unchanged. Structure HTML and per-model metadata are
prepared assets: use the legacy web’s tools/prepare_structure_assets.py, then
tools/build_structure_maps.py (TCRen environment, explicit path/hash manifest and
source metadata identity check) and tools/build_structures_metadata.py
(interface ipTM from tcr_pmhc_iptm), and place them beside the web tables.
Do not run the old reconciliation script over this projection: it derives a
second set of evidence rather than preserving the shipped rich evidence.
Reviewed ambiguous model choices are in rules/legacy_structure_representatives.tsv.
They preserve exact paired junctions and epitope, then use allele agreement or the
original source-row V gene. Unknown or changed ambiguous associations fail the export.
Reviewed experimental PDB representatives are in rules/legacy_native_representatives.tsv.
The web ZIP includes prepared web/structures_metadata.tsv[.gz] when present;
structure maps/downloads are deployed separately under the web database’s structure/.
For the legacy web display, native structures require a positive TCRen map contact
count and use ipTM=1 (100%) as an experimental-display convention. Predicted ipTM
continues to come from tcr_pmhc_iptm; native model confidence is absent.
Pass --structure-dir to the metadata adapter to use rendered CDR3–peptide
contact counts. Downloads use the same TCRen contact tables as the maps.
Dataset release versions#
Dataset releases retain YYYY-MM-DD tags, with an optional -NOTE suffix for
an explicitly distinguished variant. Use the release title for seasonal names.
The producer also accepts vYYYY.MM.PATCH: month 01–12, and patch 0 for
that month’s first release. Patches have no leading zeros. Tags and published
assets are immutable; corrections receive a new tag. A suffix does not by itself
set GitHub prerelease status. Never generate a duplicate Zenodo twin release.
The dataset version is independent of the Python package version.
release.yml pins the build to the planned source commit, records that full SHA
in manifest.json (schema_version: 1), and verifies the tag points to that SHA
before publishing. SHA256SUMS covers the manifest as well as the database
bundles and lifecycle asset. The manifest’s existing roles stay stable: Python
VDJmatch selects primary; latest-version.txt line 1 selects legacy.
Verification and previous-release changelogs select legacy by manifest role;
only historical releases without manifests use the single-ZIP fallback.
--previous accepts a local previous-release ZIP, not a tag. CI downloads the
selected asset before passing its path. The optional workflow with_web input
passes --with-web; its default is false and the full existing rich build runs
in either case. No publishing is performed by vdjdb release itself.
Every release role preserves generated table compression inside its ZIP. Logical
basenames such as vdjdb.txt, cluster_members.txt, and
vdjdb.rearrangement.tsv become .txt.gz or .tsv.gz archive members when their
source is gzip-compressed; readers accept either form. Packaging never inflates
these members. Plain generated TSV/TXT inputs above 1,000,000 bytes are rejected;
the producing writer must emit deterministic gzip first.
Paired prepared web and structure assets#
vdjdb release --tag YYYY-MM-DD --with-web --build out --out out/release
continues to emit the fresh web table and motif charts from the existing build.
With no prepared metrics or structure directory it emits a table/chart web ZIP.
For a full update, first place the accepted preparation outputs at:
out/web/prepared-assets.json
out/web/structures_metadata.tsv[.gz]
out/web/structure/asset-manifest.json
out/web/structure/<served maps, coordinates, contacts and downloads>
Preparation and sealing belong to vdjdb-web/tools/prepare_structure_assets.py
and build_structures_metadata.py; see that repository’s
tools/README.interop.md. They run on the prepared Stratos release cohort.
This release step does not rerun structures, motifs, or their scientific analyses.
The freshly emitted web table must have the exact physical-byte SHA256 recorded
by preparation, including gzip bytes. A different projection must be prepared
and sealed for its own cohort before packaging.
Schema version 1 of prepared-assets.json binds web_table_sha256 and
source_metadata_sha256 to structure/asset-manifest.json, and binds the exact
metrics and structure manifest with structures_metadata_sha256 and
structure_manifest_sha256. The structure manifest lists sorted hashes and
files entries (path, integer bytes, sha256); paths are relative to the
structure directory. Raw source metadata stays outside the release; its digest
cross-binds the two records. All served files must be sealed. Per hash, both HTML
maps, aligned PDB, contacts, amino-acid coordinates and the download ZIP are
required. Missing files, stale digests, unsealed extras or unsafe paths fail.
A complete valid preparation automatically adds role web-structures with
structure/asset-manifest.json and the sealed files under structure/. The web
ZIP includes prepared-assets.json and metrics. Both ZIPs are selected from the
same release manifest; existing primary, legacy, airr roles stay stable.
To publish a locally assembled Stratos release, transport the complete release
assets with their manifest and SHA256SUMS, verify them, and publish both web ZIPs
alongside the usual rich/legacy/AIRR assets under the selected immutable tag.
Keep the full source SHA from the same release checkout; publication must verify
the tag points to it. No publication is performed by local packaging.
For CI, produce one prepared-input ZIP containing only
web/prepared-assets.json, web/structures_metadata.tsv[.gz] and
web/structure/** (paths relative to out/). Supply with_web: true, an
immutable prepared_web_url and its exact prepared_web_sha256 to the release
workflow. CI verifies that digest, stages into a fresh out/web, then emits and
checks its own web table before making both paired ZIPs. Both URL and digest
are required together. The prepared-input archive is an explicit external input;
scientific generation remains the Stratos preparation stage. The ordinary CI
rich build and its defaults remain unchanged.
Release pointer finalization is a separate job after immutable publication. It
fetches current master, adds only the generated latest-version.txt change in a
fresh worktree and uses a normal push, retrying up to three times after races.
Concurrent source commits and the pinned release tag remain intact. Commit
failures are reported. Retrying the failed finalization job does not recreate
tags or republish assets; rerunning its helper is idempotent when already current.
Prepared release validation also requires nonempty sorted unique structure
hashes present in both the web TCR_hash column and metrics hash column.
Each download ZIP must contain the required coordinate/contact/PDB members,
with unique safe names and exact served-file bytes; reading every member checks
its CRC. Resealing an incomplete or internally stale download cannot make it a
valid release input.