AlignAIR
V(D)J allele assignment for IG and TCR repertoires.
Reads in (FASTA, FASTQ or a table), an AIRR rearrangement table out, ready for Change-O, TIgGER and SCOPer.
Pretrained human models for IGH, IGK, IGL, TRA, TRB, TRD and TRG.
Docs · Choose a model · Every option · Paper
Install
pip install alignair
Python 3.10 or newer. A GPU is optional: AlignAIR uses CUDA or Apple MPS when it finds one, else the CPU. There is
no Bioconda package. A Docker image is published as alignair/alignair (the example reads are in /app/examples).
Check it works
$ alignair doctor
AlignAIR environment
python 3.12.3
torch 2.11.0
cuda_available False
device_auto cpu
cache_dir /home/you/.cache/alignair
(Abridged.) device_auto is where predictions run; cache_dir is where downloaded models are kept.
Your first alignment
Download 20 example human IGH reads and align them with the IGH model:
curl -LO https://raw.githubusercontent.com/MuteJester/AlignAIR/v4.0.0/examples/reads.fasta
alignair predict --model alignair4-igh-human --input reads.fasta --out out.tsv
The first run downloads the model from Hugging Face and caches it; later runs start at once. You get:
aligned 20 reads (0 dropped) -> out.tsv
out.tsv is an AIRR rearrangement table, one row per read. Its first columns of interest:
sequence_id v_call d_call j_call junction_aa productive
read01 IGHVF10-G50*02 IGHD3-10*01 IGHJ6*02 CATFYYGSGSYYNFVSNYNYYGMDVW T
read02 IGHVF10-G42*01,IGHVF10-G42*03 IGHD2-2*02 IGHJ4*02 CAKGTSCNSTSCYTIDYW T
read03 IGHVF3-G12*02 IGHD5-18*02 IGHJ6*03 CARDTLNIVATPISAFAIYYYYYMDVW T
When a read cannot tell V alleles apart, v_call lists them all, comma-separated (read02), as IgBLAST does. The IG
models name alleles as OGRDB does (IGHVF10-G50*02); see Pretrained models. To align your own
reads, point --input at your file.
In Python
from alignair import Aligner, read_sequences
aligner = Aligner.from_pretrained("alignair4-igh-human")
ids, reads, info = read_sequences("reads.fasta")
result = aligner.predict(reads, ids=ids)
result.write_airr("out.tsv")
print(result.records[0]["v_call"], result.records[0]["junction_aa"])
IGHVF10-G50*02 CATFYYGSGSYYNFVSNYNYYGMDVW
result.records holds one dict per read, in Python's terms (positions from 0, True/False); write_airr writes
the AIRR table, which is what tools downstream read.
Pretrained models
| Locus | Model id | Germline set | Allele names | Alleles V / D / J |
|---|---|---|---|---|
| IGH | alignair4-igh-human |
OGRDB human IGH (HUMAN_IGH_OGRDB) |
OGRDB | 198 / 33 / 7 |
| IGK | alignair4-igk-human |
OGRDB human IGK (HUMAN_IGK_OGRDB) |
OGRDB | 168 / – / 8 |
| IGL | alignair4-igl-human |
OGRDB human IGL (HUMAN_IGL_OGRDB) |
OGRDB | 181 / – / 10 |
| TRA | alignair4-tra-human |
IMGT human TRA (HUMAN_TCRA_IMGT) |
IMGT | 76 / – / 68 |
| TRB | alignair4-trb-human |
IMGT human TRB (HUMAN_TCRB_IMGT) |
IMGT | 98 / 3 / 16 |
| TRD | alignair4-trd-human |
IMGT human TRD (HUMAN_TCRD_IMGT) |
IMGT | 14 / 3 / 4 |
| TRG | alignair4-trg-human |
IMGT human TRG (HUMAN_TCRG_IMGT) |
IMGT | 20 / – / 6 |
- First use downloads the model from Hugging Face into
~/.cache/alignair(setALIGNAIR_CACHE_DIRto move it). To work offline, download it ahead withalignair models get alignair4-igh-humanand run with--offline. - Allele names. The IG models call alleles by their OGRDB names (
IGHVF6-G21*07), the TCR models by their IMGT names. A genotype written in the other naming is refused; the Choose a model page shows how to work with IMGT-named data. - Another germline set, or novel alleles, for a species and locus a model covers: give the germline FASTA with
--reference. Another species (mouse, say): fine-tune or train a model; binding another species' germlines to a human model costs accuracy. - The models are released under GPL-3.0-or-later, as the code.
Your own data
Input: FASTA, FASTQ, or a CSV/TSV table with a sequence column (--sequence-column), gzipped or not, or - for
standard input. Reads keep their ids; a repeated id gets a _dup1 suffix. Reads longer than 575 nt are aligned on
their first 575 nt.
Output: an AIRR rearrangement TSV: all 99 columns by default, or a preset with --columns airr|core|minimal.
Beside it, out.tsv.run.json records the model, the reference and the options of the run.
Common options:
# Calls only from a donor's alleles: a YAML/JSON genotype, or the GenotypeSet `alignair genotype` writes
alignair predict --model alignair4-igh-human --input reads.fastq.gz --out out.tsv --genotype donor.yaml
# Your own germline set, novel alleles included
alignair predict --model alignair4-igh-human --input reads.fasta --out out.tsv --reference germline.fasta
# Carry 10x cell barcodes and UMI counts into the table. One locus per run: Cell Ranger's contigs mix chains,
# so split them by chain first (the metadata page shows how) and give each locus its own model.
alignair predict --model alignair4-igh-human --input igh_contigs.fasta --out igh.tsv \
--metadata filtered_contig_annotations.csv
# Many reads on the CPU: worker processes
alignair predict --model alignair4-trb-human --input tcr.fasta --out tcr.tsv --threads 8
Every option, with its default, is on the CLI reference page;
alignair predict --help lists them by purpose.
How it compares
On simulated reads held out from development (all seven loci, 13 test suites), AlignAIR is better than IgBLAST on 151 of 491 measure comparisons: the V mutation count (38 of 40), the J allele (25 of 49), segment boundaries, the exact junction and clone key, the D allele, and calling no V on a read too short to show one. On real IGH repertoires of four donors whose alleles are known from their genomes, the two tools' V calls are equally well supported, and AlignAIR calls the reads with a known answer right more often (99.7% vs 99.5% on 5' RACE libraries). The comparison page shows every measure and the method.
When another tool is the better choice:
- IgBLAST, for a species or locus no AlignAIR model covers when you cannot train one; reads longer than 575 nt you cannot trim; a D call wherever any D bases remain (AlignAIR leaves a D with fewer than 8 bases uncalled); IgBLAST's scores and e-values; or a measure your study rests on where the comparison says IgBLAST is better.
- MiXCR, for a pipeline from raw sequencing data to assembled clonotypes (UMIs, contig assembly): AlignAIR assigns V(D)J alleles to reads, it does not assemble clones.
- Immcantation stays your downstream toolkit: AlignAIR replaces its alignment step (AssignGenes and MakeDb), and Change-O, TIgGER and SCOPer read AlignAIR's table directly.
Known limits are listed on How far to trust the calls.
Documentation
The website takes you further, by what you want to do:
- Run on your data: your first alignment, prepare your input, donor genotypes, your own germline reference.
- Coming from another tool: IgBLAST, MiXCR, Immcantation.
- Look something up: every CLI option, the Python API, every output column, error codes.
- Judge the results: how far to trust the calls, the comparison with IgBLAST.
- Train or fine-tune a model for your species or germline set: do I need to train?, train, fine-tune.
Cite
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
@article{konstantinovsky2025alignair,
title = {Enhancing sequence alignment of adaptive immune receptors through multi-task deep learning},
author = {Konstantinovsky, Thomas and Peres, Ayelet and Eisenberg, Ran and Polak, Pazit and
Lindenbaum, Ofir and Yaari, Gur},
journal = {Nucleic Acids Research},
volume = {53},
number = {13},
pages = {gkaf651},
year = {2025},
doi = {10.1093/nar/gkaf651}
}
CITATION.cff holds the same reference, so GitHub's "Cite this repository" gives it too.
Support
Questions and bugs: GitHub issues. Contributions are welcome; see CONTRIBUTING.
License
GPL-3.0-or-later (see LICENSE).
Metadata
Release files for AlignAIR 4.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 | Provenance | Actions |
|---|---|---|---|---|
| alignair-4.0.0.tar.gz | 534.5 kB | With provenance | Details for alignair-4.0.0.tar.gz |
Built distributions (wheels)
Total release size: 10.5 MB
Release files / alignair-4.0.0.tar.gz
| Download URL | alignair-4.0.0.tar.gz |
|---|---|
| Size | 534.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b44d409f0d0ea13c4f8a4dbcfe315bd8351e7eb77806121d7f9886c04db6195c
|
|
BLAKE2b-256 checksum How to use checksums |
91c324e74150c40d07e63c67ea29fff581576a7ba7a0ea6c5eb3beb9b9eac58b
|
| 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 Nov 19, 2026.
Transparency logRelease files / alignair-4.0.0-cp312-cp312-win_amd64.whl
| Download URL | alignair-4.0.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 697.6 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e4e66430cd55696ab12c1cf7fc54f43f0bc0d24024c85602379ba561f819fb6b
|
|
BLAKE2b-256 checksum How to use checksums |
3020451f8a4c98249d7e6a76e18a9baed603acb8a73637392ae18b2be038c624
|
| 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 Nov 19, 2026.
Transparency logRelease files / alignair-4.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | alignair-4.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
fe9079167597aa02244eb90355294f8f73b54600780de2c0e2e970dce22a5988
|
|
BLAKE2b-256 checksum How to use checksums |
05549d227ae371b61ab2ea60dd237dd2ae3fb987c1b457a419a99345e3b19219
|
| 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 Nov 19, 2026.
Transparency logRelease files / alignair-4.0.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | alignair-4.0.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 708.6 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
87443a9c9122d098fe995794e3e19ecf5e8bd51cb60ec9f8e8b3fdd519665ff5
|
|
BLAKE2b-256 checksum How to use checksums |
40c40b26299eeef7ed46c8e107b9d7c0a44c217059e00c9b0a2309aee055e608
|
| 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 Nov 19, 2026.
Transparency logRelease files / alignair-4.0.0-cp312-cp312-macosx_10_13_x86_64.whl
| Download URL | alignair-4.0.0-cp312-cp312-macosx_10_13_x86_64.whl |
|---|---|
| Size | 708.2 kB |
| Tags | CPython 3.12 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
730281c2d7f6f70ce864dfaa42eec48000e548fb9ebaedb9ad31ff3f2d54fccb
|
|
BLAKE2b-256 checksum How to use checksums |
f43e012086cd95337200dd801c5a483cbb1697b5371a58d6dacacef6115bc1fe
|
| 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 Nov 19, 2026.
Transparency logRelease files / alignair-4.0.0-cp311-cp311-win_amd64.whl
| Download URL | alignair-4.0.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 695.8 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e2d20a56e89a1deaef31f0678f082ce944a9c430e66a1981015592bbef994ea4
|
|
BLAKE2b-256 checksum How to use checksums |
4b0aa0a2078a299fa18ebed99e3c541b925889b36315663a7aecce1e540fbd29
|
| 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 Nov 19, 2026.
Transparency logRelease files / alignair-4.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | alignair-4.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
41a8bd3c3349045bd0669757b29a46b65b0a4c7671e2613d20e049ec1507272b
|
|
BLAKE2b-256 checksum How to use checksums |
ba7b049872f90cb1187dea0fca6accd62f48ae2285266ec6c7deccc691b2979b
|
| 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 Nov 19, 2026.
Transparency logRelease files / alignair-4.0.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | alignair-4.0.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 708.8 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
68eded27e8455148e8cf6583d4cb135956a37bb7e9aaedf20ca2632a81e8a1a5
|
|
BLAKE2b-256 checksum How to use checksums |
fd45f3be5b40ebdbfa3981e29f743b8d571033bbe0b5ab9996d914307a132786
|
| 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 Nov 19, 2026.
Transparency logRelease files / alignair-4.0.0-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | alignair-4.0.0-cp311-cp311-macosx_10_9_x86_64.whl |
|---|---|
| Size | 707.7 kB |
| Tags | CPython 3.11 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
2d6cd5d6847c30ef3be422bf3cb92442b6cebfaa4726fc24f53fa15c35d4515c
|
|
BLAKE2b-256 checksum How to use checksums |
86ab94c26b5bdbb8c78dabab4b2f1868e4c3e4a137392ece53f7e1b0c8b620f8
|
| 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 Nov 19, 2026.
Transparency logRelease files / alignair-4.0.0-cp310-cp310-win_amd64.whl
| Download URL | alignair-4.0.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 696.5 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
4d728a9d1717e2e1b84a012c80dc3311bf9c39ed4792782a734e390076618b96
|
|
BLAKE2b-256 checksum How to use checksums |
a2c5b1f34ae3c25d0f1a50cb3cf9f88e58dd4ba5a2e2a53e61a8dd35604d5a0a
|
| 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 Nov 19, 2026.
Transparency logRelease files / alignair-4.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | alignair-4.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
c1b058744f50d43fee521f90073eefc63dc428cf094b9b2efa4f53b3366af495
|
|
BLAKE2b-256 checksum How to use checksums |
9995346eabc674ab4c032e23ae6f7d8583b70e156fcd01e6026cb5755d135408
|
| 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 Nov 19, 2026.
Transparency logRelease files / alignair-4.0.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | alignair-4.0.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 709.8 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
47da2f3835d5b1c14089f5074de04f592557d73e95581bd330b4b11ee9c5f90f
|
|
BLAKE2b-256 checksum How to use checksums |
c36cbcd234b9607f3f29e8eda7a9ac9ae07b5b745035f9d50fd444b9e569f756
|
| 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 Nov 19, 2026.
Transparency logRelease files / alignair-4.0.0-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | alignair-4.0.0-cp310-cp310-macosx_10_9_x86_64.whl |
|---|---|
| Size | 708.6 kB |
| Tags | CPython 3.10 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
60743e5f33abd0386d4a645ee243d97acb24704e7eb2adf42060b170d58aeeda
|
|
BLAKE2b-256 checksum How to use checksums |
61824bdd57208dc3813afa172699c4ec3e656ab3a0afae09b0588b8c0df19c70
|
| 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 Nov 19, 2026.
Transparency logSecurity for AlignAIR 4.0.0
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.
Full provenance
All 13 files in this release have been uploaded with provenance metadata.
Attestation for alignair-4.0.0.tar.gz
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 Nov 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.