bwa-mem3
A faster, more correct, drop-in replacement for bwa mem and bwa-mem2.
If you align short reads with bwa or bwa-mem2 today, bwa-mem3 will give you the same answers — only quicker, with fewer rough edges, and with first-class support for things you used to need a wrapper script for.
Why bwa-mem3
- Drop in, go faster. Same algorithm, same outputs, same flags as bwa-mem2 — but consolidated mapping speedups, a memory-bounded index builder, batched header ingestion, and a tuned allocator add up to measurable wall-clock wins on real workloads.
- Methylation in one binary. A
--methflag turns bwa-mem3 into a drop-in replacement for the entirebwameth.pypipeline. No Python, no inline conversion script, no separate post-processing step. Onebwa-mem3 index --meth ref.fa, onebwa-mem3 mem --meth ref.fa R1.fq R2.fq, done — header collapsed, tags emitted, chimeras flagged. - Stage the index once, align many. A
bwa-mem3 shmsubcommand pins the FM-index in shared memory so back-to-back runs on the same host skip the 28 GB read every time. - Correctness fixes upstream hasn’t merged yet. Tabs in
-R, 151+ bp reads, AVX-512 mate-rescue, kswvscore2plateau across NEON/AVX2/AVX-512BW, mem_sam_pe proper-pair flag — every fix tracked back to the upstream PR or issue that found it. - Architecture-aware out of the box. SSE4.1, SSE4.2, AVX, AVX2, AVX-512BW, and ARM64/NEON. A multi-binary launcher picks the right one for your CPU.
Get started in 30 seconds
git clone --recursive https://github.com/fg-labs/bwa-mem3
cd bwa-mem3 && make
./bwa-mem3 index ref.fa
./bwa-mem3 mem -t 16 ref.fa R1.fq.gz R2.fq.gz \
| samtools sort -@ 8 -o out.bam
Tip — Emit BAM directly
For production pipelines, add
--bam=0to skip the SAM text round-trip entirely. See Best Practices: Output format.
Where to start
- Installation — Build from source (Bioconda is on the way).
- Quick start: align paired-end FASTQs — Two commands to your first alignment.
- Quick start: methylation — The
one-binary
bwameth.pyreplacement, in two commands. - Best Practices — The five things that actually move the needle for production runs.
- What’s different from bwa-mem2 — Every fix and feature, with upstream cross-references.
What’s in this book
- Getting Started — Install and run your first alignment.
- User Guide — Indexing, alignment, output, threading, allocator notes.
- Performance — Where the speed comes from and how to get more.
- Best Practices — Build, run, and deploy recommendations.
- CLI Reference — Every flag, auto-captured from
--help. - Methylation Reference —
--methmode in full. - What’s Different from bwa-mem2 — The full changelog, by category.
- Developer Guide — Build matrix, SIMD dispatch, regression tests, contributing.
- Related Projects — bwa-mem3-bench, bwa-mem3-rs, fgumi, bwa-mem2 upstream.
- Reference — Glossary, citation, license, changelog.
bwa-mem3 is a derivative of bwa-mem2 maintained by Fulcrum Genomics. MIT licensed. See License and Citation.