Skip to content

minibwa

minibwa is a short-read aligner by Heng Li, billed as the successor of BWA-MEM. It indexes a reference genome with an FM-index and aligns single- or paired-end reads using a banded, SIMD-accelerated Smith-Waterman extension, adapting its parameters to the read length. Like BWA-MEM it indexes the genome before alignment.

License

The minibwa source is released under the MIT license. Note that the default build (as installed here) compiles the GPL-2.0+ BWT-construction code inherited from BWA, so the installed minibwa binary is effectively GPL.

Available

  • Roihu-CPU: 0.7, via the bio-apps module.

Usage

minibwa is part of the bio-apps collection on Roihu. Load the bio-apps module tree and then the minibwa module:

module load bio-apps/v202603
module load minibwa/0.7

minibwa has two subcommands, index and map.

Indexing a reference

Index the reference genome before aligning. Work in your project's /scratch directory rather than $HOME, which is often too small for complete genomes:

minibwa index -t 8 ref.fa

This writes the index files ref.fa.l2b and ref.fa.mbw next to the reference.

Aligning reads

Paired-end reads are aligned with two read files, producing SAM on standard output:

minibwa map -t 8 ref.fa read1.fq read2.fq > aln.sam

A single read file aligns single-end:

minibwa map -t 8 ref.fa reads.fq > aln.sam

Add -f to emit PAF instead of SAM:

minibwa map -f -t 8 ref.fa reads.fq > aln.paf

Example batch script

#!/bin/bash
#SBATCH --job-name=minibwa
#SBATCH --account=<project>
#SBATCH --output=output_%j.txt
#SBATCH --error=errors_%j.txt
#SBATCH --partition=small
#SBATCH --time=12:00:00
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8
#SBATCH --mem-per-cpu=8G

module load bio-apps/v202603
module load minibwa/0.7

# Index the reference genome (once)
minibwa index -t $SLURM_CPUS_PER_TASK ref.fa

# Align paired-end reads
minibwa map -t $SLURM_CPUS_PER_TASK ref.fa read1.fq read2.fq > aln.sam

Replace <project> with your CSC project (for example project_2001234).

See creating a batch job script for Roihu for more information about running batch jobs.

Support

CSC Service Desk

More information

November 19, 2026