Skip to content

AlignAIR 4.0.0 - #15

Merged
MuteJester merged 902 commits into
mainfrom
work/architecture
Nov 18, 2026
Merged

MuteJester merged 902 commits into
mainfrom
work/architecture

Conversation

@MuteJester

Copy link
Copy Markdown
Owner

AlignAIR 4: a new model and model format, seven pretrained human models (one per locus), a reworked user API, and a documentation site rewritten for repertoire researchers. Version 4.0.0; the CHANGELOG's 4.0.0 section lists every change.

What is in it

  • Models: alignair4-{igh,igk,igl,tra,trb,trd,trg}-human 1.0.0, already published to hf://AlignAIR/AlignAIR-pretrained (the AlignAIR 3 entries are kept). The README quickstart runs by id against them.
  • Output: an AIRR rearrangement table whose positions and CIGARs follow the schema and which Change-O's CreateGermlines.py reads as written; genotype (YAML/JSON or AIRR GenotypeSet) and germline-reference binding, IMGT/GENE-DB headers read as they are.
  • Docs: README and website (https://mutejester.github.io/AlignAIR/ deploys from main), with the comparison to IgBLAST from a locked run on held-out data.

Checks run before this PR

  • Full suite locally and in an environment built as CI builds it (CPU torch, GenAIRR 2.4.0 and numpy 2.x from PyPI): 0 failures; CI's other jobs (model validation, platform, wheel smoke, test independence) pass on Python 3.12.
  • Identity: the seven models give the same predictions in both environments (tied alleles now keep the germline set's order).
  • Not yet verified: Python 3.10 and 3.11, the Docker and conda builds; this PR's CI covers the Python matrix.

The CI and release test jobs now run in parallel with a 60-minute limit. After merge, tagging v4.0.0 runs release.yml (build, test, Docker Hub + GHCR, PyPI behind its protected environment, the GitHub release).

…probabilities its own, since a core reads the whole read for its calls and has no classifier to give spans
…nst-igblast pairs a checkpoint with it read by read, with the assay's paired statistics and the checkpoint's truth-substitution chain
…ver trained on included, and its allele calls follow the bound reference's alleles
…utes over the batch's longest read and pads its outputs back; the refiner leaves slots no read has alone; same results
…nding another reference to such a model makes its config count that reference's alleles. The chip declares it
…ence it is given, alleles it never trained on included; a fixed-head model keeps the reference identity check
…equences binds the genotype's subset of the reference for the call, refusing alleles the reference lacks; the replay pin follows predict_sequences
…apped form and anchor of the same known allele or of a close same-length variant, and a gapped genotype sequence keeps its gapped form
…tic model to the FASTA's alleles, novel ones included, completed against its own reference; a fixed-head model refuses it
…found by importing the modules ALIGNAIR_ARCHITECTURE_MODULES names, so a subprocess that loads it registers it too
…stant region around full-length reads, each read coordinate of the record moved with the read, so V start and J end are scored where real libraries put them
…a primer masked to N, a 3' constant region) around the curriculum's reads, drawn per stream after its provider, every read coordinate moved with the read
…es, inward over mismatching edge bases into pre/post and outward over flank bases that continue the germline, as the assay's intervals allow
… start; a record cache serves a flanked run, its flanks drawn after the cached records
…are provider streams, so a flanked run trains with data workers and from a record cache, its batches the serial run's
…s first 30 bases and searches the start at least 3 bases either way, so a read with a body indel keeps its V germline start

The placement check compared the whole segment ungapped against the germline, so one indel in the body pushed
the mismatch rate past the fallback and sent the read to the whole-germline scan, which moved a correct start.
The start search was gated on the rounded indel head, which reads ~0 on reads with several indels. The check now
compares only the first _START_CHECK bases at the placement's start, and the search reaches at least
_START_REACH bases (at most the length difference), the offset penalty keeping the derived start unless a nearer
k-mer match is clearly better.

Lab yardstick, V germline start: S5 indels 75.2 -> 91.4 with the chip flank model, 78.6 -> 94.8 with the shipped
1.0.0 model; S12 91.0 -> 98.6 and 91.9 -> 99.5. No suite drops beyond one read.

The golden conv-v1 rows 1 and 3 are re-recorded on their stored reads: the untrained golden model calls IGHJ6*02
on IGHJ4/5-like reads with a one-base J span, so their J placement is degenerate before and after.
…rtions, folds overhang only where the tail leaves the germline, and keeps a CIGAR's indels whatever the predicted count

The end anchor searched only the length difference, but a read with a net insertion is longer than the germline
stretch it covers, so its true end could sit out of reach and the CIGAR closed on spurious deletions. The search now
reaches the length difference plus the predicted indel count (at least _INDEL_REACH, renamed from _START_REACH as it
bounds both searches), the deeper offsets only while the window stays inside the germline.

The pure-overhang fold treated every segment longer than its germline as overhang and pulled the read end of reads
with insertions back. It now folds only when the segment's last anchor_k bases mismatch the germline at the anchored
end above fallback_rate (overhang, e.g. a J running into a constant region); a tail that follows the germline is
insertions and keeps its read coordinates.

The CIGAR derivation returned all-M on equal-length windows whenever the rounded indel count was 0, erasing balanced
insertion-deletion pairs (the indel head reads ~0.03 on reads with three or more indels). All-M is now returned only
where it is the DP's own optimum (mismatches cost less than an insertion-deletion pair), in the Python reference and
the Cython kernel alike; a new test holds the two byte-identical.

Lab dev suites (13, 3388 reads), chip flank screen: V germline end 90.11 -> 90.79, V read end 91.35 -> 91.53,
missed V indels 76 -> 6 of 235, spurious 3 -> 4; S5 (indels) V germline end 77.1 -> 86.7 before the refiner.
Shipped 1.0.0 model: V read end 59.53 -> 59.86, V germline end 60.09 -> 60.18, J germline end 86.09 -> 86.15,
V germline start 95.84 -> 95.78. Real reads (4 donors, 10k each): V end agreement with IgBLAST +0.2 to +0.55 pp.

The golden conv-v1 rows 0, 1, 3, 8 and 9 are re-recorded on their stored reads: the untrained golden model's V
windows sit at ~40% identity, and the derivation now places indels in them where it returned all-M. One of those reads
now has no J alignment (a one-base J on an empty germline span) and so no j_identity, gated or not; the D-gate test
compares the identities with .get.
…lled germline from the anchor with indels, so an indel near the V end or the J start no longer moves the boundary

The refiner's evidence compared the read with the germline ungapped from the anchor: an indel between the anchor and
the V end stopped the end at the indel, and one just before the Cys made the shifted bases before it look non-V,
throwing the V end back to the window's edge (up to 33 nt on the indel suite). The evidence is now the best banded
alignment from the anchor (BAND diagonals, GAP per inserted or deleted base, the germline's far end free), 3'- and
5'-ward; a prohibitive GAP gives the ungapped evidence back to float precision. The four walks (V and J, both
directions) run as one batch: +3.6 ms per batch whatever its size.

GAP picked on the lab's dev suites (13, chip flank screen 20k): V read end 91.15 ungapped, 91.03 / 91.50 / 91.62 /
91.53 at -2 / -3 / -4 / -6; -6 is the one that drops no suite. against-igblast with the matcher fix, pooled vs
IgBLAST: V read end 91.54 vs 91.33, V germline end 91.74 vs 91.58, V germline start 98.96 vs 97.70, J start 84.79 vs
80.02; no pooled metric IgBLAST-better, and S5 (polymerase indels) V read end 84.3 -> 92.4, V germline end 77.1 ->
91.9 (IgBLAST 91.4).
…oth tools, so a D-J read's forced V call no longer decides a comparison
…s a 5'RACE leader does, so leader Ns stop reading as a masked primer that V starts after
… D and J after the germline V, and an identity counts only the germline the read covers

Three faults in the AIRR assembly, shared by every model:

- build_sequence_alignment laid the read's V bases on the gapped germline in order, whatever the CIGAR, so after a
  V indel every later base sat in the wrong germline column. It now follows a CIGAR that spans the V window: a
  germline base the read lacks is "-", a read base the germline lacks is left out (IMGT's indel correction).
- compute_alignment_positions put D and J at p - v_sequence_start + gaps, which holds only for a V that starts at
  its germline's first base and has no indel. A read position past V now sits p - v_sequence_end columns after the
  V part, so the D and J alignment strings, identities and slices are the read's own segments.
- segment_identity counted germline the read does not reach ("." in the read) as mismatches, lowering v_identity
  by the uncovered share of V (a multiplex read starts about 9 germline bases in).

On the real pilot reads, a V indel had given v_identity 0.3-0.5 where IgBLAST gives 0.9+ (941 W-97 reads), and a
read whose V starts 133 germline bases in had a "J alignment" taken from its V. The golden conv-v1 rows change only
in their alignment strings, positions, identities and FWR/CDR strings; every D and J sequence alignment there is now
the read's bases at its coordinates (before: none was).
…own anchor, and the germline alignment lays the D and J germlines on their own read bases along their CIGARs

The end anchor slid a 15-base window along the germline, but a segment shorter than that (most D segments) was compared
with the window's first bases only, so its germline end came out 15 minus its length past its last base. The start
check then relocated the start and kept that end, and the CIGAR closed the gap with deletions: on real reads (W-97 and
three other donors, the leader-N fine-tune) 41-45% of D rows had a D CIGAR with indels (11M4D, 4M2D1M3D1M1D1M1D1M) and
the D germline end agreed with IgBLAST's on 41-42% of same-D reads against 59-61% for the D read end. The anchor is now
at most the segment's length.

The germline alignment laid the D and J germline spans end to end after the V, while the sequence alignment and the
segment positions follow the read, so a D germline span of another length than its read span moved every J germline
column: the J germline alignment equalled IgBLAST's on 64-69% of reads with the same J read span, and j_identity sat
22-26 pp below IgBLAST's on average (31-36% of reads more than 5 pp below). The D and J germlines now each take their
read span's columns along their CIGAR: a read base the germline lacks is '-', a germline base the read lacks is left
out (as the V's already are), and without a CIGAR spanning both the germline is cut to or padded with '.' to the read
span.

The golden conv-v1 rows are re-recorded on their stored reads: only the untrained golden model's one-base segments
moved (54D1M1D, 283D1M8D, 9D1M2D, 1I -> 1M). The ablation test's guard that the model's own matcher with the true
calls is not oracle quality on S0 now asserts the opposite: on the unmutated reads it differed only in d.germ_end, and
now differs nowhere.
… D gets no D call

A D-J rearrangement or a read that starts inside the junction holds no V, but every model forced a V call on it: on
real RACE reads (SC-11, 6% of the reads) a 1-5 nt V stub at identity 1.0 or a 40+ nt V at ~30% identity, which the
AIRR row then built a junction and alignments on. A read now holds no V when it holds no exact 15-mer of any V allele
of the reference (the assay's real-data truth for a read without a V: 3 of 157,188 real reads with an IgBLAST V of
100+ nt hold none) and the V the germline reader placed is no V either: under 20 read bases (the assay's least V it
asks a call of) or under 70% identity along its CIGAR. The second condition keeps a heavily mutated V that holds no
exact 15-mer: on the dev suites 23 reads with 20+ observed V bases hold none (S1 fr3_high, S2 shm_0.25, S11 fr3_igg),
and every one of them keeps its V (span 40+, identity 0.76+). On the four real donors the rule takes the V of no read
that holds one and of 41-89% of the reads that hold none.

Such a read's record has no V call or V coordinates and carries v_presence "absent"; its AIRR row is partial
(airr_assembly_reason no_v) with its D and J calls and coordinates, and no junction. The assay's diagnostics replay
mirrors the new stage (v_presence, between germline and records) and is re-pinned; its equivalence tests pass on the
random-init models and the released IGH checkpoint. The assay's small random-init test models now orient reads with
the bank vote (core.config.bank_orientation), so a read is in its V's frame as a trained head puts it: with the
random head 48 of 50 S0 reads were complemented and so lost their V. The golden conv-v1 rows are re-recorded on their
stored reads: two CDR3 fragments and one read the random-init model complements lose their V.
The germline reader gave the D the CIGAR it gives any segment, indels included: on real reads (four donors, the
leader-N fine-tune, after the short-segment anchor fix) 6-7% of D rows had a D CIGAR with indels (1M3D2M,
2M1D1M2D2M1D2M1D2M1D1M, 1I11M), mostly D calls IgBLAST makes otherwise. IgBLAST and IMGT never gap a D: its germline
span equals its read span. A D alignment with a gap is now replaced by the read's D bases at the offset along the
germline that matches most of them (among equals the one nearest the reader's placement), cut to the bases the
germline covers; a D the reader placed without a gap (most of them) is kept. A D segment of no read bases spans no
germline base instead of the whole germline as deletions (37D).

The golden conv-v1 rows are re-recorded on their stored reads: one D moves from 1I1M1I13M to 15M, and two empty D
segments lose their 37D/16D.
… call, as IgBLAST lists equally scoring ones

v_call named the top-1 alone, so a read that shows none of the positions where sibling alleles differ looked decided:
on real data most of each tool's unsupported V calls are such sibling swaps (RACE 59-78%, multiplex 22-31%), which a
genotype step downstream (TIgGER, Change-O) resolves only when the row lists the candidates. v_call now lists the call,
then every V allele the read may be called with (its locus and any genotype) that matches at least as many of the
read's V bases as the call: the read bases the call's CIGAR aligns, each compared with the allele's base at the same
IMGT column, so alleles of other lengths compare at the same positions; an allele without a base at a column matches
no read base there. The ties follow the call by matches, then in reference order. v_calls and v_call_set (the
selector's thresholded set) are unchanged.

On 3,000 real reads each (the leader-N chip), 96% of V calls stay a single allele and 3.7-5.3% list more (IgBLAST on
the same reads: 4.4-6.7%); 0.2-1.2% name another gene. The assay's diagnostics replay mirrors the new stage (ties,
after v_presence) and is re-pinned; its equivalence tests pass on the random-init models and the released IGH
checkpoint. The golden conv-v1 rows are re-recorded on their stored reads: only v_call moves, its first allele as
before (the random-init model calls one allele for every read, so its better-fitting alleles are listed).
…, and the batch size follows the device

Torch's intra-op threads scale poorly on a read batch's small convolutions: the chip reads 47 reads/s on one thread
and 137-164 on eight. alignair predict --threads N now spreads each chunk over N spawned worker processes of one
thread each (predict.parallel.ProcessPool); a worker loads the aligner from one private temporary pickle, so the
workers start together instead of one after another down their start-up pipes (9.3 s -> 2.1 s for 8). On a GPU the
option sets torch's CPU threads. The default batch size now follows where the reads run: 256 on a GPU, 16 per CPU
worker (its activations then stay closer to its cache: 8 workers read 230 reads/s at 16 against 194 at 64), and 64 in
one CPU process; --batch-size still sets it.

The assay's alignair-local runner passes its threads on as --threads, and the speed protocol times the local CLI at its
own batch size, as a user runs it. On S1 (4000 reads, i7-10700F, CPUs 0-7, RTX 3090 Ti), the leader-N chip:
8 threads 164 -> 259 reads/s (full run 26.5 s -> 19.5 s; IgBLAST 8 threads 460 reads/s, 9.6 s), CUDA 560 -> 961
reads/s (full run 10.0 s -> 7.1 s).
…is the chip on a 64-channel trunk

On the CPU the chip's trunk is 65% of a read's time (13.5 of 21 ms on one core), and its convolutions already run
near the core's peak (97 GFLOP/s, mkldnn), so the trunk is fast only with fewer multiply-adds: at the full window a
64-channel trunk takes 5.2 ms a read against 19.6 ms at 128 (separable 128: 13.5 ms). ChipCore takes the width and
hands it to the trunk, parser, anchor heads and SHM reader; lab-chipw64-v1 registers the 64-channel chip, which
trains, reloads from its model file, predicts and resumes as lab-chip-v1 does.
…e's germline

The parser places the D from the read alone, and a narrow trunk does it less well: at 20k steps the 64-channel
chip's D start and end fell 5 and 11 points below the 128-channel chip's, under IgBLAST's on most suites. The D
refiner lines the junction up with the called allele's forward or reverse complement row (the best ungapped stretch,
as the local D aligner scores every row), counts each read base's log-likelihood ratio of being that germline base
against an N base, and scores every D from s to e > s by the parser's two boundary log-probabilities plus twice the
ratios of the bases inside it, within the V end and J start the outputs place. Each boundary's logits are that score
summed over the other boundary. Only the junction's bases count, and slots no D uses stay impossible, so the
evidence never passes the impossible logit on a long read. At inference only; no weights.

On the lab's dev suites (IgBLAST 74.1% / 75.2%) the D start and end are right for 86.9% / 87.2% of reads on the
128-channel trunk (81.5% / 81.0% without) and 86.3% / 86.0% on the 64-channel one (76.2% / 69.7% without); S6 (a D
trimmed at both ends or inverted) goes from 42.6% / 42.1% to 80.5% / 80.5% (IgBLAST 72.3% / 69.7%), so no suite's
D edges trail IgBLAST's. The V and J calls and edges and the D call do not move.
…ele V calls, and the rows it moves

TIgGER's frequency rule on the product's own rows: per V gene, the reads whose tie list is a single allele, the most
frequent alleles until they explain 87.5% of them, genes with fewer than 10 such reads left open. A row moves when its
call is outside the genotype and its tie list holds an allowed allele.
alignair.__all__ is the thirteen supported names, sorted, without its noqa:
Aligner, PredictionResult, TrainingConfig, TrainingRun, run_training,
ReferenceSet, read_sequences, iter_sequences, write_airr, AirrWriter,
compare_airr, AlignAIRError and __version__.

AlignAIR, AlignAIRConfig, PredictConfig and resolve_device leave the package
namespace; they stay in alignair.core, alignair.core.config, alignair.predict
and alignair.aligner. DuplicateMetadataIdError and
PredictionCountMismatchError are in alignair.errors.

read_sequences, iter_sequences, write_airr and AirrWriter are the supported
file helpers: their docstrings no longer call them back-compat.
…a is gone

load_metadata, the in-memory loader only tests used, is removed, and
lookup_metadata_rows takes build_metadata_index's index only: its mapping
branch is gone, so one shape reaches the join. alignair.io exports
MetadataIndex, SequenceReadBatch, build_metadata_index,
iter_sequence_batches and lookup_metadata_rows; the parsing internals
(iter_sequence_records, RawSequenceRecord, SequenceRead,
detect_sequence_format) stay importable from their modules. MetadataIndex's
methods are documented and the module's public functions typed. The tests
join through the index.
…s registry= everywhere

publish_bundle, publish_local and upload_version are maintainer tools: they
stay in alignair.registry.publish and leave the package's __all__, as do the
submodules. alignair.registry exports DEFAULT_REGISTRY, resolve_model,
resolve_sources, find_model, load_registry, validate_registry,
maybe_notify_updates and the Hugging Face helpers.

A registry list has one name, registry=, as on Aligner.from_pretrained:
resolve_model(registry=) (was sources=), maybe_notify_updates(registry=)
(was sources_list=), resolve_sources(registry) (was cli), and the registry
argument of find_model and verify_installed. One registry may be given as a
string: from_pretrained(registry="file://...") used to split it into
characters and fail to resolve the id.
Every function, method and property of the public packages (alignair,
alignair.errors, alignair.io, alignair.registry, alignair.reference,
alignair.model_file, alignair.analyze and alignair.evaluate) has type hints
on all parameters and its return, and a test walks the public API to keep it
so. The walk (tests/support/public_api.py) is shared with the docstring test,
which now covers alignair.errors and alignair.io as well.

GenAIRR, torch and huggingface_hub types are imported under TYPE_CHECKING;
the reference package's import guard skips those blocks, which never run.
The wheel and release jobs' contract script called run_benchmark with two
names group 2 removed; it runs the API that exists, and a new test runs the
script on the source tree so the suite catches that drift.

Prediction: with_genotype refuses a segment given one string (it was split
into characters) as a genotype file does; batch_size=None means "auto" again,
as in AlignAIR 3, and another string is refused naming "auto"; the locus
refusal names several loci as loci; predict_iter(ids=) reports a read that is
not a string as the input's error.

Training: TrainingConfig checks the device, window, has_d, model option
values and paths when it is built; an unknown device is a ConfigurationError
in Python and on the CLI; alignair.train exports the run, its settings and
the callback's types, not the engine and the loop; on_iteration is hinted
with the TrainingIteration it receives; a custom reference's novel-allele
note says it names no species.

Errors, registry and CLI: a missing model file is MODEL_NOT_FOUND wherever
one is read, a resume path without a checkpoint too; a Hugging Face failure
is classified by its cause (a disk error stays an OSError, an invalid repo id
or hf:// spec is an InputError, a gated repo names the token, nothing unknown
is retryable); a malformed version entry is REGISTRY_INVALID; three hints
that promised a dataconfig name say DataConfig; a registry given as one
string or an iterator is read as given; the five model resolvers share one
help text.
Part 2's changes in [Unreleased], relative to v3.0.0: one way to train and
one way to predict, with_genotype, the locus refusal, from_alleles, the
top-level exports, registry=, the error classes and codes, the registry and
hub failure classes, alignair info by id, --json, and the removed functional
API and CLI spellings. The part 1 bullets these changes made false are
corrected.
- alignair predict --help groups its options by purpose (model, input and
  output, output columns, metadata join, genotype and reference,
  performance, quality gates, messages).
- alignair reference export --gapped writes each V allele IMGT-gapped, as
  Change-O's CreateGermlines.py needs; a V allele without a gapped form is
  refused by name.
- --genotype reads the AIRR GenotypeSet that alignair genotype (and
  --genotype-out) writes, each allele's segment from its name.
- alignair train --init-from MODEL starts a run from a model's weights (a
  model file, registry id or hf:// repo), as TrainingConfig(init_from=)
  does in Python.
- The reference-without-D and AlignAIR 3 refusals, the CLI's description
  and the help texts use plain words.
- examples/reads.fasta is 20 clean, productive human IGH reads, written by
  examples/make_example_reads.py.
website/scripts/site_data.py writes website/src/data/*.json: every CLI
option of every command (predict's in its purpose groups), the 99 output
columns with their kind, unit and meaning (alignair.io.columns_doc), every
error code with what it means and what to do, the public Python API, the
seven pretrained models (from their model files) and a search index. The
comparison with IgBLAST stays pending until a locked test-split run; the
generator refuses a development-split run.

Tests fail when a generated file drifts from the code, when a command shown
on the website does not parse (four pages still to be rewritten are strict
expected failures), or when a link or heading anchor leads nowhere. The
site's own unit tests run with npm test (node --test), also in the website
workflow, now on Node 24.
…dark theme

The top bar leads to the docs, the models, the CLI and Python references
and, apart, the developer pages, with a search box (Ctrl/Cmd-K or "/") over
pages, headings, CLI options, output columns, models and error codes, and a
light/dark switch (set before the first paint). The docs sidebar shows one
journey, the user's or the developers', and Previous/Next never cross from
one to the other. Each page has breadcrumbs and an "On this page" outline;
a link to a heading keeps the hash route (?h=<id>).

Examples get CLI | Python tabs that switch together and are remembered; a
copy button copies a transcript's commands without prompt or output. Tables
render the generated data (options, columns, models, error codes, the
comparison, the Python API). Navigation, search ranking, heading links and
the tab and copy rules are pure modules tested with node --test.
The README is the first stop for a repertoire researcher: install, a check
that it works, a first alignment of 20 example IGH reads with its real
output, the same run in Python, the seven pretrained models with their
germline sets and allele naming, input and output, how AlignAIR compares
with IgBLAST and when another tool fits better, the documentation by goal,
and how to cite.

The website's home page leads with the same first run and the model table.
New pages: Get started (install, your first alignment, concepts for
repertoire researchers, how AlignAIR works), Coming from IgBLAST, MiXCR and
Immcantation, and Use on your data (choose a model, prepare your input, a
donor genotype, your own germline reference, sample and cell metadata,
output columns, running at scale, fixing common problems). The pages they
replace are retired and links repointed.

Checks: the README's shape, plain words and release-day wording on the
user's pages, headings with ids, every command in a code block or CLI tab
parsing against the real CLI, and links to pages the next group writes kept
on a list that can only shrink.
The rest of the documentation, written for a repertoire researcher:
Understand the results (output columns explained, how far to trust the
calls, the comparison with IgBLAST and its method), Reference (every CLI
option, the Python API, the output column dictionary, model cards, error
codes, cache and offline use), Train or fine-tune (do I need to train,
train, fine-tune, evaluate, share), Project (cite, support, changelog) and,
apart, Developers (architecture, testing, publishing, contributing). The
example READMEs use the AlignAIR 4 model ids and link to their pages.

The old pages and the Learn lessons are gone; their addresses redirect to
the page that replaced them. The comparison table shows error measures in
their own unit, not as percentages; each error row has its own link target;
the column dictionary says only v_call lists tied alleles; the public
docstrings the Python API page shows use plain words.

Checks: no expected failures remain. Every search result and site link,
table rows included, leads to a page; every retired address redirects to a
live one; every user page and the Python API page use plain words; container
pins are checked on every page.
…ound

- The AIRR table follows the schema's positions and CIGARs: every position
  is 1-based and closed, the FWR/CDR positions count in `sequence`, each
  CIGAR spans the read (S, ungapped N, M/I/D, S), v_germline_start/end
  count in the IMGT-gapped V germline as Change-O's MakeDb writes them,
  germline_alignment holds N in the untemplated bases, a row without a D
  call holds every V-J base in np1, and FWR4 is IMGT's FR4 from the J
  Trp/Phe codon. CreateGermlines.py builds the germlines of 2,855 of 2,872
  complete rows of 3,000 real IGH reads from the table as written. Calls,
  junctions, CDR3, identities and sequence coordinates are unchanged;
  Python records keep Python's terms.
- An AIRR GenotypeSet given to --genotype restricts only the genes it
  names; one that deletes genes or lists undocumented alleles, or is not
  shaped as the schema gives it, is refused by name.
- --reference reads IMGT/GENE-DB headers: the allele is the field with a
  `*`, as Change-O reads it.
- The AIRR table, the rejects file and the --infer-genotype table end their
  lines with \n, not \r\n.
- alignair benchmark skips simulated reads with no bases left, so it runs
  at its defaults on TRB; a stratum that leaves almost none is refused,
  naming it.
- The assay's AIRR reader takes the V germline span from the CIGAR, so it
  reads these tables, MakeDb's and IgBLAST's, and still drops the V CIGAR
  of an AlignAIR 3 row.
- The --reference help says which anchors come from a close variant;
  the CHANGELOG records this part's product changes.
…phone layout

Two readers (an IgBLAST/Immcantation user with bulk IGH, a 10x TCR/MiXCR
user with mouse samples) used the docs to do their work; every fix below was
run as written.

- 10x: one locus per run; a chain-by-chain recipe for Cell Ranger contigs
  (split, a model per locus with --metadata, pairing by cell_id), a
  sample_id recipe, and why cropped 10x contigs are expected.
- Trust: how often reads of another locus get complete rows, and a filter
  that drops them; a check for a 575-nt cut that reaches the J.
- Immcantation: CreateGermlines on the table as written, a TIgGER round
  trip (novel alleles and a genotype back into AlignAIR), one novel-allele
  recipe, pRESTO headers, binding IMGT's germline set and mapping names, and
  how alignair genotype's rule differs from TIgGER's.
- T cells: clonotypes, downstream tools, comparing with Cell Ranger's or
  MiXCR's AIRR tables, and what the real-data check covers.
- Species: --reference for another germline set of the same species;
  another species is fine-tuned or trained, with measured costs and a
  mouse TRB example. Running at scale: measured CPU throughput and memory,
  --threads, a SLURM array and Apptainer.
- README and Home: the species wording, the 10x line, IgBLAST's
  better-choice list as on the comparison page; the Coming-from card links
  all three tools.
- Search matches each section's prose and ranks a whole word above a
  prefix ("TRA" finds the TRA model first). Tables stack and inline code
  wraps on a phone; CLI help and error meanings show their code spans.
A read longer than 575 nt is aligned on its first 575 nt. When that cut
fell inside the J (a forward read with a long leader, as on some 10x
contigs), the row said complete while its J call, junction and FWR4 rested
on part of the J. A row whose J alignment runs to the cut, the read's end
for a forward or complemented read and its start for a reverse-complemented
or reversed one, is now partial with airr_assembly_reason j_cropped.

On 92 IGH reads given 100-320 nt of leader, all 40 rows whose junction
changed are now partial and no row whose J ends before the cut is flagged;
reverse-complemented, all 92 stay complete. The column dictionary lists
every assembly reason, and the pages that described a manual check now
filter on the status.
The real-data test split's four donors (SC-4, SC-6, W-89, W-131) were used
during development, so they move to dev, and four donors nobody has looked
at become the test split: SC-13, SC-17, W-110 and W-52, the next two
smallest single-AIRR-seq-run paired donors of each cohort (the rule that
chose the first eight), each with its VDJbase P25 genomic sample. Their
runs, read counts, ENA and ODP pins, FASTQ md5s and VDJbase files are
pinned from verified downloads.
pyproject.toml, CITATION.cff and the conda recipe say 4.0.0; the workflow
wrappers (Galaxy, Nextflow, Snakemake) pin the alignair/alignair:4.0.0
image, as test_container_pins requires; the recipe test reads the version
from pyproject.toml instead of naming it. The Python API page's
__version__ is regenerated. The CHANGELOG's section gets its version and
date when the release is tagged.
The card listed the export's 28 internal metrics by their code names
(bank_v_size, scan_v_top1, parse_v_start_exact, ...), which is what
alignair info shows for a published model. It now gives the measures a
user can read (V, D and J allele, D present or absent, orientation, V/D/J
boundary error in nt, mutation rate and indel count errors), says what they
were measured on (up to 192 held-out simulated reads per germline set, the
model's own calls before germline refinement) and points to the full
validation_report.json.
The seven alignair4-<locus>-human models are in the catalog at 1.0.0
(hf://AlignAIR/AlignAIR-pretrained), so the examples, the docstrings and
the reference and developer pages drop their placeholders for the ids and
the default registry. The pinned validation models are the published
alignair4-igh-human and alignair4-igk-human 1.0.0 files (checked against
the hub's downloads); the light-chain fixture is igk_model.
The comparison page and the README report the locked runs, on data no
model was developed on: held-out simulated reads of all seven loci (13
suites, a fresh seed) and real IGH repertoires of four donors new to the
assay, whose alleles are known from their genomes.

The page opens with the results at a glance, generated from
comparison.json: AlignAIR's wins by family of measures (V mutation count,
J and D alleles, segment boundaries, exact junction, clone key, V calls on
short or V-less reads, V indels), each as wins out of every comparison
with its largest gain, and the real-data measure per library protocol
beside the known-answer accuracy. The method follows, then every measure
of every suite per locus. The generator keeps only the real-data run's
declared measures (the report itself is half a megabyte), and TRD and TRG
are said to lack the novel-allele suite, which needs more V genes than
they have.
The CHANGELOG's section is 4.0.0 (2026-11-18) and names the published
models; the changelog page's summary adds the AIRR/Change-O table and the
cut-J status, and says the genotype rule is like TIgGER's rather than
TIgGER's own. The release-tag URLs of the example reads (README, Home,
first alignment) lose their placeholder comments: they point at v4.0.0.
A confident model gives several alleles exactly the same float32 score.
The candidate set sorted them with numpy's default argsort, which is not
stable and orders exact ties differently between numpy versions and CPUs
(numpy 1.26 and 2.x disagree), so a fresh install could list, and even
call, a different allele than the same model elsewhere: on the identity
reads, numpy 2.x gave another IGH and another TRA V call. Ties now keep
the germline set's order (a stable sort); both environments give the same
outputs on all seven models. test_alleles_tied_at_a_score_keep_the_banks_order
failed on the old code.
Checked in an environment built as CI builds it (CPU torch, GenAIRR 2.4.0
and numpy 2.x from PyPI, alignair installed from the checkout, one process).

- The assay tests' conftest put the frozen GenAIRR first on the path even
  when the session had already imported GenAIRR from site-packages, so the
  training data workers of every later test imported another GenAIRR and
  refused to start (and the lab's screen commands exited with status 2).
  It changes the path only when the freeze took.
- The golden rows compare their continuous values within a tight tolerance
  (they move by about 1e-6 with the thread count) and keep calls, ties,
  junctions, coordinates and strings exact; near-tied names may swap only
  within their run of tied places.
- Subprocess tests (the installed contract, the assay's diagnose, the lab's
  convert) import the package the test imported, not an installed copy.
- The audit's positive control runs on the CPU; the screen message test
  reads GenAIRR's version; the audit's frozen-copy check applies only when
  the session runs on the frozen copy.
- The training records' default policy is a module-level constant, which
  both ruff 0.17.1 and 0.17.5 accept without a noqa.
- The CI and release test jobs run the suite in parallel (-n auto) with a
  60-minute limit; one process took far over the 20 minutes.
npm audit fix (no major-version changes) moves the site's locked
dependencies to patched versions: react-router and react-router-dom
6.30.6 (two open-redirect advisories; React Router ships in the site),
vite 6.4.6, postcss 8.5.33, browserslist 4.29.6, source-map-js 1.2.2 and
baseline-browser-mapping 2.11.38. The build and the site's tests pass.
- atomic_write fsynced the temporary file through a read-only handle;
  Windows' fsync (FlushFileBuffers) refuses one with EBADF, so every
  training checkpoint (alignair train, alignair demo) failed on Windows.
  It now opens the file for writing to flush it. A test swaps in an fsync
  that refuses a read-only descriptor, as Windows does (RED -> GREEN).
- artifact_url joined a plain local registry path with urljoin, which
  reads a Windows drive (C:) as a URL scheme and dropped the folder, so a
  registry given as C:\models opened nothing; a path is joined as a path.
  local_path drops the slash before a drive letter in file:///C:/... as
  urllib's url2pathname does; the relative file://catalog form is
  unchanged. Both with tests that failed first.
…machine

- 35 tests that train a model, a lab screen or a record cache end to end
  take minutes on a 4-vCPU runner with coverage: they carry a new `heavy`
  marker and run in a test-heavy job (3.12, -n auto, 30-minute per-test
  limit); the 3.10-3.12 matrix runs the rest with coverage. release.yml
  has the same split, and its builds wait for both test jobs, so every
  test runs before anything is published.
- The statistics comparison's output is checked field by field, floats
  within 1e-12 relative (two p-values differ by one ulp between glibc
  2.39 and 2.43), against a recorded fixture instead of a byte hash.
- The first-batch training pin compares its losses within 1e-6 relative
  (float32 sums follow the CPU's kernels).
- The speed protocol tests no longer need a host with 8 CPUs.
- Two registry tests: ~ is set through USERPROFILE as well (Windows), and
  a Windows path goes into TOML as a literal string.
- The developer page lists the heavy marker.
_train_args hashed the source checkpoint with hashlib.file_digest, which
Python 3.11 added; the package supports 3.10, where a resumed or
warm-started run failed with AttributeError when it recorded the source's
checksum. It uses alignair.io.files.sha256_file. The resume test runs
without hashlib.file_digest, as on 3.10 (RED -> GREEN).
- The site data generator drops the " (default: True)" Python 3.10's
  argparse appends to an on/off option's help, so the generated data is the
  same on every Python (the drift test failed on 3.10).
- The dependency-pin test reads pyproject.toml with tomli where Python
  3.10 has no tomllib, as the other tests do.
- The two record-cache pool tests allow 600 s: their worker processes
  import torch and GenAIRR, which took over 120 s under coverage on the CI
  runner (8 s locally); a hang still fails.
@MuteJester
MuteJester merged commit c4f5d5c into main Nov 18, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant