Strobealign is a fast and accurate read mapper. It aligns single-end and paired-end reads to a reference genome and outputs SAM, PAF, or contig abundances. Indexing is fast enough (under a minute for a human genome) that it is done on the fly by default.
See also the full documentation.
# Install (see below for building from source)
conda create -n strobealign strobealign samtools
conda activate strobealign
# Paired-end reads -> sorted BAM
strobealign -t 8 ref.fa reads_1.fq.gz reads_2.fq.gz | samtools sort -o aln.bam
# Single-end reads
strobealign -t 8 ref.fa reads.fq.gz | samtools sort -o aln.bam
# Mapping only, no base-level alignment (PAF output, faster)
strobealign -x -t 8 ref.fa reads_1.fq.gz reads_2.fq.gz > aln.paf
# Short reads for variant calling: add read group, exclude GRCh38 ALT contigs
strobealign -t 8 --rg-id=S1 --rg=SM:sample1 --exclude-alt GRCh38.fa reads_1.fq.gz reads_2.fq.gz | samtools sort -o aln.bam
# Metagenomic abundance estimation (for binning)
strobealign -t 8 --aemb contigs.fa reads_1.fq.gz reads_2.fq.gz > abundances.tsvStrobealign is available from Bioconda. Follow the Bioconda setup instructions. Then
conda create -n strobealign strobealign samtools # install strobealign
conda activate strobealign # activate environment
strobealign --version # test the installationStrobealign can also be installed from Homebrew using
brew install strobealignTo compile from source, you need a recent Rust version, which you can get via Rustup (the Rust packaged with Debian and Ubuntu is usually too old). Then
git clone https://github.com/ksahlin/strobealign
cd strobealign
RUSTFLAGS='-C target-cpu=native' cargo build --releaseThe binary is then available at target/release/strobealign.
strobealign -t 8 ref.fa reads_1.fq.gz reads_2.fq.gz | samtools sort -o aln.bam # paired-end
strobealign -t 8 ref.fa reads.fq.gz | samtools sort -o aln.bam # single-end
strobealign -t 8 --interleaved ref.fa reads.fq.gz | samtools sort -o aln.bam # interleaved or mixedPiping directly into samtools avoids writing large intermediate SAM files.
Strobealign works best for read lengths between 100 and 500 bp. It estimates the
read length from the input and picks indexing parameters to match (see
read profiles).
Useful options: -N INT outputs up to INT secondary alignments, -U suppresses
unmapped reads, --eqx writes =/X instead of M in CIGAR strings, and -x
skips base-level alignment and outputs PAF
(see mapping-only mode).
Add read group information so that downstream tools (GATK, bcftools, DeepVariant) can identify the sample:
strobealign -t 8 --rg-id=S1 --rg=SM:sample1 --rg=LB:lib1 --rg=PL:ILLUMINA \
ref.fa reads_1.fq.gz reads_2.fq.gz | samtools sort -o aln.bamWhen mapping to GRCh38 with ALT contigs (such as the reference bundled with
BWA or GATK), use --exclude-alt. ALT contigs duplicate regions of the primary
assembly, so without this option, reads in these regions get MAPQ 0 and may be
assigned to the ALT contig. Strobealign recognizes ALT contigs by name
(*_alt, *_decoy, HLA-*) and prints a warning if it detects them while
--exclude-alt is not given.
TODO
With --aemb, strobealign outputs a table of contig abundances instead of
alignments, for use with metagenomic binners:
strobealign -t 8 --aemb contigs.fa reads_1.fq.gz reads_2.fq.gz > abundances.tsvEach row holds a contig name and its abundance: the number of bases mapped to the contig divided by its length, where a read mapping to n locations counts 1/n toward each.
The index is built on the fly by default. When mapping many small libraries against the same reference, you can save time by writing it to disk once:
strobealign --create-index -t 8 -r 150 ref.fa # creates ref.fa.r150.sti
strobealign --use-index -t 8 ref.fa reads_1.fq.gz reads_2.fq.gz | samtools sort -o aln.bamSee index files for details.
- Full documentation at Read the Docs: all command-line options, read profiles, index files, and how strobealign works
- Changelog
- Contributing
- Run
strobealign --helpfor the full list of options
If using v0.17.0 or later:
Tolstoganov, I., Martin, M., Buchin, N., and Sahlin, K. Multi-context seeds enable fast and high-accuracy read mapping. Genome Biol (2026). https://doi.org/10.1186/s13059-026-04017-x
If using v0.16.1 or earlier:
Sahlin, K. Strobealign: flexible seed size enables ultra-fast and accurate read alignment. Genome Biol 23, 260 (2022). https://doi.org/10.1186/s13059-022-02831-7
Strobealign is available under the MIT license, see LICENSE.