Fast, self-contained NLR immune-receptor locus annotation for plant genomes
Install · Quick start · Features · Performance · Citation
FastNLR scans the six reading frames of a genome assembly for amino-acid motifs and assembles them into NLR (Nucleotide-binding, Leucine-rich Repeat) immune-receptor loci. It combines multithreading, memory-mapped FASTA input, embedded default motif profiles, checkpoint resume, and coordinate-consistent multi-format outputs.
NLR genes encode a major class of plant intracellular immune receptors and are a key target of disease-resistance breeding. FastNLR identifies complete and partial NLR loci directly from an assembled genome, or classifies NLR domains from a protein FASTA. It is distributed through bioconda as well as prebuilt release binaries and source.
conda install bioconda::fastnlrcurl -L -o fastnlr.tar.gz \
https://github.com/CropCoder/FastNLR/releases/download/v1.6.0/fastnlr-x86_64-unknown-linux-gnu.tar.gz
tar -xzf fastnlr.tar.gz
./fastnlr --versionRelease assets follow the fastnlr-<target>.tar.gz naming scheme (Windows builds use .zip,
macOS assets are also .tar.gz) and ship with a SHA-256 checksum file.
# Requires Rust 1.85+
git clone https://github.com/CropCoder/FastNLR.git
cd FastNLR
cargo build --release
# binary: target/release/fastnlrPackage page: https://anaconda.org/bioconda/fastnlr · Packaging recipe: conda/
# 1. Genome (DNA) mode — built-in motif library, 8 threads
# -> results/<genome>.nlr.txt, .nlr.gff, .nlr.bed, .motifs.bed, .nbarc.fasta,
# .loci.fasta, .stats.tsv, .summary.txt, .plots/
fastnlr -i genome.fasta -o results -t 8
# 2. Protein mode — HMMER domain scan on a protein FASTA (no genome coordinates)
# -> protein_results/<prefix>.domains.tsv, .nlr.tsv, .summary.txt, .plots/
fastnlr --protein -i proteins.fa -o protein_results
# 3. Resume a run (skips the expensive scan)
fastnlr -i genome.fasta -o results --checkpoint ckpt/Run fastnlr --help for the full flag reference, or see the
project page for annotated examples, output-format
details and benchmark results.
- Zero-config, self-contained binary — the standard
mot.txt(PWM) andstore.txt(CDF) configs are embedded at compile time; override with-x/-yfor custom motifs. - High performance — Rust + rayon multithreading, memory-mapped FASTA parsing and SIMD scoring; throughput holds at roughly 3.7 Mb/s across the benchmarked 197 Mb–4.7 Gb range.
- Flexible seeding, on by default — category/rank-based seeding runs out of the box and
recovers divergent NLR/RNL loci. It is additive: it never drops a locus that the exact
motif-id combinations would have found (
--no-flexible-seedrestores the strict behaviour). - HMM-assisted N-terminal domains — when the PWM library does not identify a CC/TIR domain,
the locus is checked with the same bundled HMMER profiles used in protein mode. HMM hits fill
that missing N-terminal domain instead of leaving a bare
NBARC-LRR. - Tandem-repeat aware assembly — repeated or duplicated domain units and trailing NB-ARC segments are merged back into their parent locus, so one gene is not reported as several loci.
- RNL-aware default library — the default profile includes the classic 20 motifs plus
RNL/helper-CC profiles 21 and 23 and conservative
CC,1seeds. This recovers ADR1-L1 without relaxing the global PWM p-value threshold. An optional 28-motif RNL/TIR library remains available for broader exploratory scans. - Protein input mode —
--proteinclassifies domain architecture with a bundled HMMER 3.4 port (Pfam NB-ARC / TIR / Rx_N / RPW8 / R1-type at gathering thresholds) plus the PWM LRR motifs. The output reports both structural class (for exampleCC-NBARC-LRR) and biological family (TNL/RNL/CNL/NB-only/TIR-only), so RPW8-type ADR1/NRG1 proteins are not mislabeled as CNL merely because they share the same CC-NBARC-LRR architecture. - Strict resumable runs — checkpoints include input/profile/configuration fingerprints and are reused only when the current run is compatible. Incomplete or stale checkpoints fail explicitly; every run writes a human-readable summary, per-chromosome/per-motif TSV statistics and PNG plots.
Benchmarked on 18 plant genomes from 197 Mb to 4.7 Gb, 8 threads, warm cache, median of 3 runs:
| Genome | Size | Wall time | Peak RSS |
|---|---|---|---|
| Cucumis sativus (cucumber) | 197 Mb | 53.5 s | 210 MB |
| Glycine max (soybean) | 991 Mb | 269.5 s | 968 MB |
| Hordeum vulgare (barley) | 4.3 Gb | 1174 s | 4159 MB |
| Zanthoxylum bungeanum (pepper) | 4.7 Gb | 1230 s | 4625 MB |
Peak memory stays close to 1:1 with genome size (ratios 0.97–1.15), so budget RAM of the same
order as the assembly. Multithreading scales 13–19× from 4 to 128 threads on the largest genomes;
keep -t at or below the physical core count. The sensitive recall preset
(--motif-accept-p/--motif-prelim-p relaxed) is diagnostic only: it inflates runtime by
roughly 40× and is not intended for production runs.
Accuracy (RefPlantNLR, 400 curated NLR CDS): 99.75% gene recall and 96.49%
domain-architecture agreement — rising to 98.19% when the 12 reference entries whose
Structure and Subclass columns contradict each other are excluded. Per-domain F1 is
1.000 (NB-ARC), 0.999 (LRR), 0.995 (TIR) and 0.989 (CC).
cargo build --release # optimized build
cargo test --workspace # 69 tests
cargo fmt --all -- --check # formatting
cargo clippy --workspace --all-targets -- -D warningsThe release profile uses opt-level=3, lto="fat", codegen-units=1 and panic="abort".
CI (.github/workflows/rust.yml) builds and tests pushes to main and pull requests; pushing a
vX.Y.Z tag builds Linux/Windows/macOS binaries and uploads them to GitHub Releases.
A dedicated manuscript is in preparation. Until then, please cite this repository:
FastNLR: a high-speed, accurate NLR annotation tool. https://github.com/CropCoder/FastNLR
GPL-3.0-only. See LICENSE.