FastNLR scans the six reading frames of a genome assembly for amino-acid motifs and assembles them into complete and partial NLR loci with multithreading, memory-mapped input, checkpoint resume, and coordinate-consistent output.
conda install bioconda::fastnlr
Install from bioconda, grab the prebuilt binary, or compile from source. Every path produces the same self-contained executable.
# recommended: install from bioconda conda install bioconda::fastnlr # add channels explicitly if they are not in your conda config # (conda-forge must come before bioconda) conda install -c conda-forge -c bioconda bioconda::fastnlr # mamba / micromamba are drop-in and much faster mamba install -c conda-forge -c bioconda bioconda::fastnlr # then annotate a genome fastnlr -i genome.fasta -o result
The -o directory contains the full result set prefixed by the genome
filename: *.nlr.txt, *.nlr.gff, *.nlr.bed,
*.motifs.bed, *.nbarc.fasta, *.loci.fasta,
*.stats.tsv, *.summary.txt, and *.plots/.
Package page:
anaconda.org/bioconda/fastnlr.
One flag, one job. Compose exactly the outputs you need.
fastnlr -i genome.fasta -o results
fastnlr -i genome.fasta -o results -t 8
fastnlr -i genome.fasta -o results --no-flexible-seed # opt out
fastnlr -i genome.fasta -x custom_mot.txt -y custom_store.txt -o results
source data/motif_library_rnl_tir/flags.sh # adds 8 motifs
fastnlr --protein -i proteins.fa -o protein_results
Short options are -i/-x/-y/-o/-t/-n; everything else is long-form.
Run fastnlr --help for the same reference on the command line.
| Input | Description |
|---|---|
| -i <genome.fasta> | Input genome FASTA, may be gzip-compressed. Required. |
| -x <mot.txt> | PWM config (optional; default: built-in). |
| -y <store.txt> | CDF config (optional; default: built-in). |
| Motif library metadata — only for custom libraries | Description |
|---|---|
| --motif-category ID=CAT | Declare the domain category for a motif id outside the built-in tables, e.g. 21=CC,25=TIR. Repeatable or comma-separated. |
| --seed-combination IDS | Add a seed motif-id combination, e.g. 21,4; separate combinations with semicolons. |
| --signature IDS | Add a fragment signature, e.g. 25,26; multiple signatures separated with semicolons. |
| Sensitivity / recall | Description |
|---|---|
| --flexible-seed <n> | Flexible seeding threshold: seed when at least n NB-ARC motifs appear in strictly increasing rank order (a repeated motif does not qualify). On by default (n = 3). Additive — exact motif-id seed combinations stay active, so loci found without this flag are never lost. |
| --no-flexible-seed | Disable flexible seeding and fall back to the exact motif-id seed combinations only. |
| --require-ploop | Require the P-loop motif (motif_1) for flexible seeding (higher precision). |
| --relaxed-seed <n> | Relaxed seeding: accept a consecutive hit run with at least n NB-ARC motifs. Off by default and mutually exclusive with flexible seeding — pass --no-flexible-seed to use it. |
| --motif-accept-p <p> | Final motif-accept p-value threshold (default 1e-5). |
| --motif-prelim-p <p> | Fragment prefilter p-value threshold (default 1e-4). |
| Output & run control | Description |
|---|---|
| -o <OUTPUT.DIR> | Output directory (created if missing). Required. All results are written here with the input genome filename as prefix. |
| --flank <bp> | Flanking bases for loci sequence extraction (default 2000). |
| -t <n> | Threads (default: auto-detect). |
| -n <n> | Fragments per batch (default 1000). |
| --checkpoint <dir> | Save/load motif results to skip rescan. |
| --tmpdir <dir> | Temp directory. |
| --progress <auto|bar|simple|off> | Progress bar (default auto). |
| --log-level <lvl> | trace / debug / info / warn / error (default info). |
| Protein mode | Description |
|---|---|
| --protein | Treat -i as a protein FASTA and scan domains with HMMER instead of translating a genome. Mutually exclusive with the genome-only flags (--flank, --relaxed-seed, --flexible-seed, --require-ploop, --signature, --seed-combination, --checkpoint). |
| --hmm <FILE> | Extra HMM domain models (repeatable, may hold several models per file). A model with the same accession replaces the built-in one; new accessions are appended. |
Everything below is written by default into -o, prefixed by the
input genome filename (without the .fa/.fasta/.fna/.gz extension).
| Genome (DNA) mode | Contents |
|---|---|
| <prefix>.nlr.txt | One row per NLR: seqname, name, domain-class, start, end, strand. |
| <prefix>.nlr.gff | GFF3 with a live timestamp; source column = FastNLR. |
| <prefix>.nlr.bed | BED12, colour-coded blocks (green = complete, orange = partial, red = contains stop codon). |
| <prefix>.motifs.bed | Motif intervals with p-values (the full per-motif hit detail). |
| <prefix>.nbarc.fasta | P-loop-anchored NB-ARC multiple alignment with gap padding. |
| <prefix>.loci.fasta | Extracted ±flanking sequence, reverse-complemented on the reverse strand. |
| <prefix>.stats.tsv | Global / per-chromosome / per-motif statistics. |
| <prefix>.summary.txt | Human-readable run summary (counts, class breakdown, output list). |
| <prefix>.plots/ | PNG statistics plots: motif counts, per-chromosome NLRs, NLR types. |
##gff-version 2 ##source-version FastNLR V1.5.3 ##date 2026-10-12 15:23:36 ##Type DNA
Protein mode (--protein) | Contents |
|---|---|
| <prefix>.domains.tsv | One row per domain hit: protein id, source (hmm/pwm), model, model name, category, coordinates, bitscore, p-value, whether it passed the Pfam gathering threshold. |
| <prefix>.nlr.tsv | One row per NLR candidate: class, N-terminal domain, has_nbarc/has_tir/has_lrr, completeness and a compact domain map. |
| <prefix>.summary.txt · .plots/ | Model set, thresholds, counts by class, and PNG plots. |
A self-contained pipeline that installs from bioconda and runs out of the box on any FASTA — no extra config files, no setup.
Rust with rayon multithreading, memory-mapped FASTA parsing, and SIMD (wide) cross-window scoring. Plant genomes finish in seconds to minutes.
The standard mot.txt (PWM) and store.txt (CDF) configs are embedded at compile time. Run on any FASTA with no extra files.
Loci FASTA extraction matches the reported GFF/BED coordinates exactly across every contig.
Run --protein on a protein FASTA to scan NLR domains with a bundled HMMER 3.4 port (Pfam NB-ARC / TIR / Rx_N / RPW8 / R1-type at gathering thresholds) plus the PWM LRR motifs, and get a domain architecture call per protein. --hmm adds your own models.
--checkpoint saves motif results after the scan; reruns skip the expensive scanning step and go straight to assembly.
Human-readable summary, TSV statistics (global / per-chromosome / per-motif), and PNG plots out of the box — no external tools.
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 seed combinations would have found (--no-flexible-seed restores the strict behaviour).
Every assembled locus is re-scanned with the same bundled HMMER profiles used in protein mode, so N-terminal CC/TIR domains the PWM library misses are still reported instead of collapsing to a bare NBARC-LRR.
Repeated or duplicated domain units and trailing NB-ARC segments are merged back into their parent locus, so a single gene is not reported as several split loci.
The default build ships the built-in 20-motif profile. The repository also contains an optional library that adds eight motifs.
| Motifs | What they add |
|---|---|
| 21–24 | RNL / helper-NLR N-terminal CC motifs (ADR1, NRG1 and Solanaceous NRC). |
| 25–28 | TIR-family motifs, covering short and TIR-only loci that the standard [18,15,13] seed could miss. |
# enable the extended library (declares categories, seeds and signatures) source data/motif_library_rnl_tir/flags.sh fastnlr -i genome.fasta -o out \ -x data/motif_library_rnl_tir/mot.txt \ -y data/motif_library_rnl_tir/store.txt \ --motif-category "$TIS_MOTIF_CATEGORY" \ --seed-combination "$TIS_SEED_COMBINATION" \ --signature "$TIS_SIGNATURE"
Because these motifs live outside the built-in rule tables they must be enabled together with
their declared categories, seeds and signatures; flags.sh holds the complete
parameter lists. Measured effect: RNL / helper-NLR recall rises from 3/8 to 8/8, at the
cost of more TIR loci being split — see the
library README
for the design rationale and regeneration workflow.
Each crate owns a single responsibility; the dependency graph flows bottom-up.
mot.txt (PWM) and store.txt (CDF); embedded default config support.fastnlr.Memory-mapped FASTA parsing and SIMD scoring keep throughput flat across two orders of magnitude of genome size. Measured on 18 plant genomes, 8 threads, median of 3 runs.
| Genome | Size | Threads | Wall time | Peak RSS |
|---|---|---|---|---|
| Cucumis sativus | 197 Mb | 8 | 53.5 s | 210 MB |
| Glycine max | 991 Mb | 8 | 269.5 s | 968 MB |
| Hordeum vulgare | 4.3 Gb | 8 | 1174 s | 4159 MB |
| Zanthoxylum bungeanum | 4.7 Gb | 8 | 1230 s | 4625 MB |
Throughput holds at roughly 3.7 Mb/s end to end, and peak memory stays close to 1:1
with genome size (ratios 0.97–1.15 in the benchmark) — 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, since oversubscription costs performance.
| Recall on RefPlantNLR (400 curated NLR CDS) | Gene recall | RNL / helper NLR |
|---|---|---|
| Default (20 motifs) | 98.25% | 3 / 8 |
| Flexible seed | 99.50% | 8 / 8 |
| Extended (28 motifs) | 99.50% | 8 / 8 |
| Protein mode (HMM) | 99.50% | 8 / 8 |
DNA mode reaches 96.49% domain-architecture agreement with the curated annotation —
98.19% once the 12 reference entries whose Structure and
Subclass columns contradict each other are excluded — with per-domain F1 of
1.000 (NB-ARC), 0.999 (LRR), 0.995 (TIR) and 0.989 (CC). LRR calls reach 99.7% sensitivity
at 100% specificity, and no gene is reported as split loci.
69 unit and integration tests cover coordinate mapping, six-frame translation, motif scanning, three-step assembly with tandem-repeat absorption, protein-mode domain classification, seeding rules, log formatting, and every output format.
_.##date reflects the current system time.##source-version and source column relabeled FastNLR.FastNLR is developed and maintained by Jiwen Zhao. A dedicated manuscript is in preparation; until then, please cite this repository:
Jiwen Zhao. FastNLR: a high-speed, accurate NLR annotation tool. github.com/CropCoder/FastNLR