AlignAIR
A neural aligner for immunoglobulin (IG) and T-cell receptor (TCR) repertoires. A single end-to-end
model predicts V/D/J allele calls, segment coordinates, and the junction, and writes standard AIRR
output. Constrain calls to a donor genotype (a subset of the model's reference), or train a model for
your own reference / species.
📖 New to AlignAIR? Start on the docs site — reference, guides, and interactive lessons:
mutejester.github.io/AlignAIR
Overview
- End-to-end neural model. One network reads orientation, localizes the V/D/J segments, calls alleles, and estimates productivity and mutation rate from a shared representation in a single forward pass, with no multi-stage heuristic search. Deterministic post-processing then turns those predictions into refined coordinates, the junction, and a standard AIRR record.
- Self-contained models. Each model embeds a fingerprinted germline reference and loads without executing any pickle. Pretrained human IGH, IGK+IGL, and TRB models are a command away (
--model <id>); the germline catalog travels with the model. - Donor genotype constraint. At inference you can restrict calls to a subset of the model's reference (a donor genotype, as YAML or FASTA) with no retraining. Adding alleles, a new species, or a new locus requires training a new compatible model.
- Uncertainty-aware. When a read cannot distinguish alleles (e.g. short fragments), AlignAIR reports a candidate set (
*_call_set) rather than forcing a single call. Optional per-allele confidence calibration is available as a separate step. - AIRR output. Standard AIRR rearrangement TSV (V/D/J calls, coordinates, junction, productivity) that reads directly into Change-O / Scirpy / Immcantation.
- Validated on a frozen, ground-truth benchmark. AlignAIR is evaluated on a simulated 2,600-case / 13-stratum human-IGH benchmark with known truth (clean, SHM, indels, fragments, arbitrary orientation), scoring V/D/J allele accuracy, segment coordinates, the junction, productivity, and orientation. A verified v3.0.0 head-to-head against IgBLAST, with full model and IgBLAST provenance, is in preparation and will be published with the benchmark. See benchmarks and known failure modes.
Install
pip install "AlignAIR[cli]" # core + CLI (recommended)
alignair doctor # verify Python / PyTorch+CUDA / GenAIRR
Install extras: [cli] (CLI + model download + AIRR validation + parasail), [train] (training
extras), [all]. PyTorch is auto-detected for GPU; for a CPU-only install, pip install torch --index-url https://download.pytorch.org/whl/cpu first.
Or Docker (no local install needed):
docker pull ghcr.io/mutejester/alignair:latest
docker run --rm ghcr.io/mutejester/alignair:latest doctor
# align reads: mount an input dir + an output dir, and persist the model cache across runs
docker run --rm \
-v "$PWD:/data" -v alignair-cache:/home/appuser/.cache/alignair \
ghcr.io/mutejester/alignair:latest \
predict --input /data/reads.fasta --out /data/out.tsv --model alignair-igh-human
The default image is CPU-only; pin a version tag (ghcr.io/mutejester/alignair:3.0.0) for reproducibility. The
container runs as a non-root user, so mount a writable output dir (add --user $(id -u):$(id -g) if
your host uid differs). Models are not baked in - the alignair-cache volume above keeps a downloaded
--model <id> from being re-fetched on every run. GPU is auto-detected when you run in a CUDA base image.
Quick start
See it work end-to-end in one command - offline, no model download needed (it trains a tiny demo model, aligns simulated reads, validates the AIRR output, and runs the donor-genotype path):
alignair demo
Or use a pretrained model - downloaded automatically from the public model hub on first use, no login:
alignair models list # human IGH, IGK+IGL, TRB (fetched live from the hub)
alignair predict --input reads.fasta --out out.tsv --model alignair-igh-human
# restrict calls to a donor's genotype (a subset of the model's reference) - YAML or FASTA
alignair predict --input reads.fasta --out out.tsv --model alignair-igh-human --genotype donor.yaml
--model <id> downloads + hash-verifies + caches the model on first use (pin a version with
--model <id>@<version>). --genotype constrains the run to a subset of the model's reference - no
retraining.
Prefer your own reference or species? Train a model, then align with it:
alignair train --dataconfig HUMAN_IGH_OGRDB --out my_model --preset desktop # ~minutes on a GPU
alignair predict --input reads.fasta --out out.tsv --model my_model/bundle/model.alignair
See examples/ for runnable data.
Reference: donor subsets now, new references by training
Each model is tied to the germline reference it was trained on (embedded and fingerprinted in the model file). What you can do with it:
- Constrain to a donor's genotype - a subset of the model's reference - with
--genotype donor.yamlordonor.fastaat predict time. No retraining; calls are restricted to that donor's alleles. - Add alleles / a new species / a new locus - this changes the model's allele universe, so train a new compatible model (novel alleles are not callable by a model that was not trained on them):
# train for any of GenAIRR's ~90 built-in references (human, mouse, rat, rabbit, dog, ...)
alignair train --dataconfig MOUSE_IGH_IMGT --out runs/mouse_igh --preset desktop
# or train from your OWN germline FASTAs (custom reference or species)
alignair train --v-fasta v.fasta --d-fasta d.fasta --j-fasta j.fasta \
--chain-type BCR_HEAVY --out runs/my_ref --preset desktop
This writes checkpoints to runs/.../ plus a self-contained, pickle-free runs/.../bundle/model.alignair
(the reference is embedded), a model_card.md, a reference_manifest.json, and a
validation_report.json. Presets: quick (smoke), desktop, full (paper-grade). Preview the
reference/config/model size without training with --plan. Then just
alignair predict ... --model runs/.../bundle/model.alignair.
Output
alignair predict writes a schema-valid AIRR rearrangement TSV (validates against the official
airr library; reads back with Change-O / Immcantation): sequence_id, sequence, rev_comp,
productive, v_call/d_call/j_call, junction/junction_aa, gapped sequence_alignment /
germline_alignment, per-gene *_cigar, *_identity, and sequence/germline coordinates, plus a
per-gene candidate-set column (*_call_set) for alleles a read cannot distinguish. The gapped
alignment fields are produced by AlignAIR's own IMGT-gap reconstruction (no external aligner required;
parasail is bundled in [cli] for exact CIGARs and the fast reader).
Every run also writes a <output>.run.json provenance sidecar (model + fingerprint, reference,
command, device, seed, and package versions). Validate any TSV explicitly:
alignair validate-airr out.tsv # structural check: columns, coordinate/CIGAR bounds, productivity
Commands
| Command | Purpose |
|---|---|
alignair demo |
offline end-to-end trial (tiny train → predict → validate → genotype) |
alignair predict |
align reads → AIRR rearrangement TSV |
alignair train |
train a model for your own reference / species (built-in dataconfig or custom FASTA) |
alignair models |
list / download / manage pretrained models |
alignair reference |
list built-in references, or export a model's reference |
alignair compare |
agreement report between two AIRR TSVs (e.g. AlignAIR vs IgBLAST) on your data |
alignair validate-airr |
structural check of a rearrangement TSV (columns, coordinate/CIGAR bounds, productivity); not the official AIRR-C schema validator |
alignair doctor |
check the environment (Python, PyTorch+CUDA, GenAIRR, parasail) |
alignair convert |
convert a legacy checkpoint into a versioned, fingerprinted .alignair |
Run alignair <command> --help for options.
Documentation
Full docs, reference, and interactive lessons: https://mutejester.github.io/AlignAIR/
- Getting started
- Pretrained models
- Command-line reference
- Benchmarks
- Design & internals
- Troubleshooting
Development
git clone https://github.com/MuteJester/AlignAIR && cd AlignAIR
pip install -e ".[dev]"
pytest
See CONTRIBUTING.md and CHANGELOG.md.
Citation
If you use AlignAIR, please cite:
Thomas Konstantinovsky, Ayelet Peres, Ran Eisenberg, Pazit Polak, Ofir Lindenbaum, Gur Yaari. Enhancing sequence alignment of adaptive immune receptors through multi-task deep learning. Nucleic Acids Research, Volume 53, Issue 13, 22 July 2025, gkaf651. https://doi.org/10.1093/nar/gkaf651
License
GPL-3.0-or-later (see LICENSE).
Contact
Issues: GitHub issues · Email: thomaskon90@gmail.com · Site: https://alignair.ai
Release files for AlignAIR 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| alignair-3.0.0.tar.gz | 278.1 kB | Details |
Built distributions (wheels)
Total release size: 4.8 MB
Release files / alignair-3.0.0.tar.gz
| Download URL | alignair-3.0.0.tar.gz |
|---|---|
| Size | 278.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
57a7c34c240651d624ad814aed24749fdfa497c40d115aaa34ba5d644129c863
|
|
BLAKE2b-256 checksum How to use checksums |
153ce9ca47db29d5a19be0d8ea21afb2148e1b4411a8f87ac02ba742970731ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency logRelease files / alignair-3.0.0-cp312-cp312-win_amd64.whl
| Download URL | alignair-3.0.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 353.4 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
2d70180005da0fd09d63b1691a9866739362f207f28ef68e8ee0bd39d69461c9
|
|
BLAKE2b-256 checksum How to use checksums |
2e99f94887d64198b7bf8b37c27f49ae7fd174b6ee6359eeddc306e8ab3c79d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency logRelease files / alignair-3.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | alignair-3.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 467.1 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
e79b0dbd7a4fa1935d38a69595d7088a142fa9a401ce3e21cd68450ec648635d
|
|
BLAKE2b-256 checksum How to use checksums |
e6063997cf9bb06d203934340972ae33f8c616e039f0697772108a786fad625e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency logRelease files / alignair-3.0.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | alignair-3.0.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 355.6 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1f8dc39c091ef446b93423883a36dd757f723b5efcc5fd88bd53f438468a5dfe
|
|
BLAKE2b-256 checksum How to use checksums |
aa4f00e311078577b6b4544e527b15f081e0802bbcff2693a85df852bd244d19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency logRelease files / alignair-3.0.0-cp312-cp312-macosx_10_13_x86_64.whl
| Download URL | alignair-3.0.0-cp312-cp312-macosx_10_13_x86_64.whl |
|---|---|
| Size | 354.7 kB |
| Tags | CPython 3.12 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
f917640c6064376511aa481d9ac1ceffb60b9e755bdd263b650ff98e8a600bfd
|
|
BLAKE2b-256 checksum How to use checksums |
67703fd66db3ad8a36bf937b82a08a6b9e6728da3f54e33ec3cf85b121245237
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency logRelease files / alignair-3.0.0-cp311-cp311-win_amd64.whl
| Download URL | alignair-3.0.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 352.9 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
45e58c9cda7298e29c41535dc8b72b10ce43bad61b582c0b478345c3e2809db1
|
|
BLAKE2b-256 checksum How to use checksums |
1a381225151d3fd0b87472048fda052af435b9ec60ded9be985d58d068682684
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency logRelease files / alignair-3.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | alignair-3.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 460.2 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
a5b1edf07396790a92ef33228c316d787c3b95419e9ccd4bf8b91c2de271eb83
|
|
BLAKE2b-256 checksum How to use checksums |
448037f239d30a5c50875d279398372306bd1117e2a9f8ebf229814451c70268
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency logRelease files / alignair-3.0.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | alignair-3.0.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 354.8 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
299e0c414984a6af1d466da254932ae229eabb02fbf99ca373bde374caf0b661
|
|
BLAKE2b-256 checksum How to use checksums |
73d1f3f6f2afd8082e97d8dc08fb792204e95a7ffa0b7c7d9c80bf5af03e49c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency logRelease files / alignair-3.0.0-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | alignair-3.0.0-cp311-cp311-macosx_10_9_x86_64.whl |
|---|---|
| Size | 354.2 kB |
| Tags | CPython 3.11 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
55cb644a33ee89270e9add344d7f66758383e51f893050d0bfa4d7cde03650f6
|
|
BLAKE2b-256 checksum How to use checksums |
3e413aa5870d1b8c8565e1f7c14fee8c1373148be1dacab2e3bcc99fc6c4d0ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency logRelease files / alignair-3.0.0-cp310-cp310-win_amd64.whl
| Download URL | alignair-3.0.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 352.9 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a9217c8adfa51df29d2e5285e43e82695900448b59c8d3efa43a9ee2720093aa
|
|
BLAKE2b-256 checksum How to use checksums |
2b75cdb1ef71dadfdc77145caac93866ff017534b79f37fd1eccfc224b68c03f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency logRelease files / alignair-3.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | alignair-3.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 451.6 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
47e313f25ba0e2b52c55e25a9fef22253be194c370ab13f04814649442fc7a1e
|
|
BLAKE2b-256 checksum How to use checksums |
45d1b690d128726719aa14a847c67fb7966900fb5db3c91e80345364a963adba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency logRelease files / alignair-3.0.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | alignair-3.0.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 355.0 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3fdaf7daa16a4107bcc9d8f2d165046159ef790932d4c84cca54ee29d73e29b9
|
|
BLAKE2b-256 checksum How to use checksums |
647f49e5940da72b36134d53ad10f9a6e8ec3b78cbab25575d5527ef20b2581c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency logRelease files / alignair-3.0.0-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | alignair-3.0.0-cp310-cp310-macosx_10_9_x86_64.whl |
|---|---|
| Size | 354.3 kB |
| Tags | CPython 3.10 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
0c393ab5dbd020c49ebd9193c86a8a898ed430c10b13fbf9b30d4dd2d02e4284
|
|
BLAKE2b-256 checksum How to use checksums |
4d647efad81029234f36f54b88533dd82c9ba90a74f773615b5c51ff6397c096
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency log