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.

GPL-3.0 License
Rust 1.85+ toolchain
bioconda Linux & macOS
fastnlr 1.7.2 — TAIR12 validation
$ fastnlr -i TAIR12_genomic.fna -o results -t 8
# TAIR12 · 142.5 Mb genome · built-in motifs
[INFO] flexible seeding · min_nbarc = 3
[OK] 7,918 fragments scanned across 5 chromosomes
[OK] 4,929 motifs assembled into 210 NLR loci
[OK] HMM N-terminal annotation · 2 loci updated
[OK] 9 result files written to results/
Done in 43.6 s · peak RSS 162 MB
210NLR loci
4,929Motifs
43.6 sWall time
Install

Up and running in one command

shell
# 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

# 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 *.summary.json. Package page: anaconda.org/bioconda/fastnlr.

Usage

Common workflows

One flag, one job. Compose exactly the outputs you need.

Basic annotation
fastnlr -i genome.fasta -o results
Multithreading
fastnlr -i genome.fasta -o results -t 8
Flexible seeding (on by default)
fastnlr -i genome.fasta -o results --no-flexible-seed # opt out
Custom motif config
fastnlr -i genome.fasta -x custom_mot.txt -y custom_store.txt -o results
Extended RNL / TIR library
source data/motif_library_rnl_tir/flags.sh # adds 8 motifs
GFF3-guided protein mode
fastnlr -i genome.fasta --gff annotation.gff3 -o annotation_results

CLI reference

Browse options by task. Short flags are -i/-x/-y/-o/-t/-n; run fastnlr --help for the command-line reference.

-i <genome.fasta>Required

Genome FASTA input, optionally gzip-compressed.

--gff <annotation.gff3>Optional

Use GFF3 gene models instead of six-frame scanning. The longest CDS transcript is selected per gene.

-o <OUTPUT.DIR>Required

Output directory. It is created if missing, and the input filename becomes the output prefix.

-x <mot.txt>Built-in

Optional PWM profile. The standard profile is embedded when omitted.

-y <store.txt>Built-in

Optional CDF profile paired with the custom PWM file.

--flank <bp>2000

Flanking bases included on each side of an extracted locus sequence.

Output formats

Files are written into -o by default and prefixed by the input genome filename after removing .fa, .fasta, .fna or .gz.

Genome-driven mode

DNA annotation results

9 files
<prefix>.nlr.txt

Six-column NLR report: sequence, name, class, start, end and strand.

<prefix>.nlr.gff

GFF2 locus intervals with the live run timestamp and FastNLR as source.

<prefix>.nlr.bed

BED12 motif blocks with completeness and stop-codon colours.

<prefix>.motifs.bed

Per-motif intervals, scores and p-values.

<prefix>.nbarc.fasta

P-loop-anchored NB-ARC multiple alignment.

<prefix>.loci.fasta

Locus sequences with flanking bases and strand-aware orientation.

<prefix>.stats.tsv

Global, per-chromosome and per-motif statistics.

<prefix>.summary.txt

Human-readable counts, class breakdown and output inventory.

<prefix>.summary.json

Machine-readable results for GUIs, web services and R reporting.

Show GFF2 header example
##gff-version 2
##source-version FastNLR V1.9.2
##date 2026-11-09 14:53:40
##Type DNA
GFF3-guided mode

Gene protein classification results

9 files
<prefix>.gff.cds.fasta

Longest-transcript CDS sequences in gene direction.

<prefix>.gff.proteins.fasta

Translated proteins used for ordered HMM scanning.

<prefix>.gff.domains.tsv

Domain evidence with protein, CDS and genomic coordinates.

<prefix>.gff.genes.tsv

All translated gene/transcript classifications.

<prefix>.gff.nlr.tsv

NLR candidate subset with class, family and domain layout.

<prefix>.gff.nlr.gff3

Gene-level NLR annotations in GFF3.

<prefix>.gff.skipped.tsv

Models skipped because of missing contigs or invalid structures.

<prefix>.gff.summary.txt

Human-readable run and classification summary.

<prefix>.gff.summary.json

Machine-readable counts and domain model metadata.

Features

Built for speed, shipped self-contained

A self-contained pipeline that installs from bioconda and runs out of the box on any FASTA — no extra config files, no setup.

High performance

Rust with rayon multithreading, memory-mapped FASTA parsing, and SIMD (wide) cross-window scoring. Plant genomes finish in seconds to minutes.

Zero-config binary

The standard mot.txt (PWM) and store.txt (CDF) configs are embedded at compile time. Run on any FASTA with no extra files.

Coordinate-consistent

Loci FASTA headers match the sliced sequence after applying --flank and contig-boundary clamping. GFF/BED report the unflanked core locus, so the intervals are equal only when --flank 0.

GFF3-guided protein mode

Add --gff to select the longest CDS transcript per annotated gene, translate it from the genome, and classify the protein with 23 bundled Pfam HMMs. LRR is accepted as C-terminal evidence only when it lies after NB-ARC. --hmm adds your own models.

Resumable runs

--checkpoint saves motif results atomically after a complete scan; reruns skip the expensive scanning step and go straight to assembly. A versioned manifest rejects stale inputs, profiles, thresholds or runtime rules instead of silently reusing mismatched results.

Rich reporting

Human-readable summary and TSV statistics (global / per-chromosome / per-motif) out of the box — no external tools.

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 seed combinations would have found (--no-flexible-seed restores 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 bundled HMMER profiles also used in GFF3-guided protein mode. HMM hits fill the 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 a single gene is not reported as several split loci.

Motif library

Extended RNL / TIR library

The default build ships 22 motif profiles: the classic 20 plus conservative RNL/helper-CC profiles 21 and 23. The repository also contains the full optional 28-motif RNL/TIR library.

MotifsWhat they add
21–24RNL / helper-NLR N-terminal CC motifs (ADR1, NRG1 and Solanaceous NRC); 21 and 23 are also present in the conservative default profile.
25–28TIR-family motifs, covering short and TIR-only loci that the standard [18,15,13] seed could miss.
shell
# 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. Historical Wm82 testing showed improved RNL/helper-NLR coverage; current RefPlantNLR measurements are reported in the performance table below. See the library README for the design rationale and regeneration workflow.

Architecture

A layered Cargo workspace

Each crate owns a single responsibility; the dependency graph flows bottom-up.

01
FASTA
chop · overlap
→
02
Translate
six frames
→
03
Scan
PWM + CDF
→
04
Filter
signature
→
05
Assemble
3-step + absorb
→
06
Output
multi-format
nlr-coreDomain model + hardcoded rule tables (rank / class / color / seed / signature / consensus).
nlr-configParse mot.txt (PWM) and store.txt (CDF); embedded default config support.
nlr-seqSix-frame translation, reverse complement, codon table, FASTA reader, chopper.
nlr-scanSliding-window scoring + non-overlap arbitration + signature pre-filter (SIMD).
nlr-assemblefindSeeds → mergeSeeds → elongate three-step assembly, plus tandem-repeat absorption.
nlr-domainProtein-mode HMMER domain scanning (NB-ARC / TIR / CC) + architecture classification.
nlr-outputtxt / GFF / BED / motifBED / alignment-fasta / loci-fasta / TSV output.
nlr-reportRun statistics aggregation.
nlr-plotStandalone optional PNG plotting library; not invoked by the CLI result pipeline.
nlr-cliclap CLI entry + pipeline orchestration (rayon + checkpoint + SIGINT); binary: fastnlr.
Performance

Genome-scale, memory-efficient

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.

18
Genomes benchmarked
69
Tests passing
6
Reading frames
4
Conda platforms
GenomeSizeThreadsWall timePeak RSS
Cucumis sativus197 Mb853.5 s210 MB
Glycine max991 Mb8269.5 s968 MB
Hordeum vulgare4.3 Gb81174 s4159 MB
Zanthoxylum bungeanum4.7 Gb81230 s4625 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 recallRNL / helper NLR
Default (22 motifs; flexible on)99.75%8 / 8
Flexible seed (explicit; same semantics)99.75%8 / 8
Extended (28 motifs)99.75%6 / 8
Protein mode (HMM)99.50%6 / 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.

Correctness

Implementation notes

Unit, integration and documentation tests cover coordinate mapping, six-frame translation, motif scanning, three-step assembly with tandem-repeat absorption, protein-mode domain classification, seeding rules, checkpoint integrity, strict profile parsing, and every output format.

1The NB-ARC alignment FASTA uses corrected P-loop location logic.
2The NB-ARC alignment FASTA replaces stop codons and unknown amino acids with _.
3The loci FASTA applies a unified coordinate clamp on the last contig.
4The loci FASTA extracts from every contig, not only the first.
5The loci FASTA keeps extracted coordinates consistent with the reported GFF/BED coordinates.
6##date uses the current system time; checkpoint resumes retain the first-run timestamp for byte-identical output.
7GFF ##source-version and source column relabeled FastNLR.
8p-value rendering in motif BED / export TSV uses scientific notation for very small values.
Citation

Acknowledgements

FastNLR is developed and maintained by the project contributors. A dedicated manuscript is in preparation; until then, please cite this repository:

FastNLR: a high-speed, accurate NLR annotation tool. github.com/CropCoder/FastNLR
Changelog

Version history

Release timeline of FastNLR with a short summary of what changed in each version.

v1.9.2 2026-11-12

HMM filtering, completeness finalization, and deterministic motif output now share the same result path across fresh runs and checkpoint recovery. Release assets use the platform-specific Windows installer name and omit separate SHA256 summary files.

v1.9.1 2026-11-10

GFF3-guided gene protein annotation with longest-transcript selection, CDS translation, streaming multithreaded HMM/PWM scanning, protein/CDS/genomic domain coordinates, and an optional annotation workflow across CLI, desktop, and Web APIs.

v1.8.0 2026-11-09

Native Windows and Apple Silicon desktop applications with live progress, cancellation, persistent history, result tables, summary charts, and automated GitHub release packaging.

v1.7.2 2026-11-08

Linux x86_64 release binaries now build against glibc 2.17, restoring compatibility with CentOS 7, RHEL 8, Debian 11, Ubuntu 20.04, and newer.

v1.7.1 2026-11-08

TIR-specific significance threshold, evidence-weighted N-terminal arbitration, and completeness reporting temporarily disabled.

v1.7.0 2026-11-03

Web server, service layer, desktop scaffold, and visualization; loci extraction restricted to the matching contig; release asset naming adjustments.

v1.6.0 2026-10-30

Decouple plot generation from CLI outputs and ship runtime fixes.

v1.5.4 2026-10-21

Correct version-sensitive documentation.

v1.5.3 2026-10-16

Require strictly increasing rank for flexible seeding.

v1.5.2 2026-10-15

Document the relaxed-seeding mutual exclusion in CLI help.

v1.5.1 2026-10-12

Colourise logs only when attached to a terminal.

v1.5.0 2026-10-12

Accurate domain calls, tandem-repeat-aware assembly, and slimmed output.

v1.4.1 2026-10-11

Add PF12061 (R1-type CC) HMM and apply workspace-wide rustfmt/clippy cleanup.

v1.4.0 2026-10-09

Add protein input mode with bundled HMMER domain scanning.

v1.3.2 2026-10-08

Validate motif profiles and stop fabricating significant hits when the CDF is incomplete.

v1.3.1 2026-10-08

Make NB-ARC alignment robust to extra motifs and deduplicate motifs in assembled loci.

v1.3.0 2026-10-01

Add flexible seeding, a unified output directory, and plotting fixes.

v1.2.0 2026-09-23

Improve CLI UX by surfacing the repository, author, issues, releases, and license.

v1.1.1 2026-09-20

Require explicit input/output flags and align CLI and source versions.

v1.1.0 2026-09-20

Support motif libraries beyond 20 motifs with CLI-declared categories, seeds, and signatures; add TIR-only seeding and the optional extended RNL/TIR library; streaming chop with fragment-level parallelism.

v1.0.0 2026-08-20

First public release — six-frame translation, PWM+CDF motif scanning, three-step locus assembly, and multi-format output.