Read alignment and variants · Software
BWA
A sequence alignment package that maps DNA sequencing reads against large reference genomes using FM-indexing.
What BWA is
BWA (Burrows-Wheeler Aligner) is a software package designed for mapping DNA sequence reads against large reference genomes, such as the human genome. Developed by Heng Li and Richard Durbin, it provides computational routines to locate where sequencing reads originate along a genome.
The package addresses the challenge of aligning high-throughput sequencing data efficiently and accurately across different read lengths and sequencing technologies. It is divided into three primary algorithms: BWA-backtrack, tailored for short reads up to 100 base pairs; BWA-SW; and BWA-MEM. BWA-MEM is designed for reads ranging from 70 base pairs to several megabases, offering improved speed and accuracy for both short reads above 70 base pairs and longer sequence fragments.
Sequence alignment with BWA serves as a core upstream step in genomics workflows, enabling researchers to process single-end and paired-end datasets, detect chimeric alignments, and handle alternate reference contigs such as those in GRCh38.
How it works
BWA operates by first indexing the reference genome using an FM-index, which is built upon the Burrows-Wheeler transform. This index structure allows rapid exact and inexact substring searches against reference sequences exceeding four gigabases in total length, provided individual chromosomes do not exceed two gigabases.
For sequence alignment, users invoke different sub-commands corresponding to specific algorithms. BWA-backtrack executes via the aln command in conjunction with samse or sampe for single-end or paired-end reads. Longer queries and reads with insertions, deletions, or structural variations are processed with the bwasw or mem algorithms, which execute local alignments. In BWA-MEM, split alignments caused by chromosomal translocations, gene fusions, or large deletions are reported with one primary alignment and supplementary alignments flagged and clipped in the output SAM file.
Key facts
- Version
- 0.7.19
- Algorithms
- BWA-backtrack, BWA-SW, BWA-MEM
- Indexing method
- FM-index based on the Burrows–Wheeler transform
- Build dependencies
- zlib
- Input formats
- FASTA, FASTQ
- Output format
- SAM, SAI
- Maximum individual chromosome length
- 2 GB
What you can use it for
- Short-read alignment
- Mapping Illumina single-end or paired-end reads shorter than 70 base pairs using the BWA-backtrack algorithm via the aln, samse, and sampe commands.
- Standard high-throughput sequencing mapping
- Aligning Illumina, 454, or IonTorrent single-end and paired-end reads longer than 70 base pairs to a reference genome using BWA-MEM.
- Long-read sequencing alignment
- Mapping PacBio subreads or Oxford Nanopore reads with high error rates to a reference using specialised preset flags in BWA-MEM.
- Assembly contig and clone mapping
- Aligning assembled contigs or clone sequences spanning up to several megabases against a reference genome.
- Human genome analysis with ALT contigs
- Aligning reads against the GRCh38 assembly containing alternate contigs using BWA-MEM in combination with post-processing scripts.
Run it here
BWA is preinstalled on the machine behind every research conversation. Ask the agent in plain language, or give it the exact command — it runs it, reads the output and explains it.
Try asking
“Map my reads to this reference with bwa mem and report the alignment rate.”
Strengths and limits
Good at
- BWA-MEM aligns reads ranging from 70 base pairs up to several megabases with high accuracy and speed.
- Handles error rates exceeding 20% when aligning Oxford Nanopore reads using specialised parameters.
- Performs local alignment to identify chimeric reads, gene fusions, and structural translocations.
- Supports reference genomes with a total length exceeding four gigabases.
Watch out for
- Individual chromosomes within the reference genome cannot exceed two gigabases in length.
- BWA-backtrack and BWA-SW do not properly support mapping to GRCh38 alternate (ALT) contigs.
- Coordinate-sorted FASTQ files containing clusters of centromeric reads cause substantial memory consumption and distort insert-size estimates.
- Long-read mapping in BWA-MEM has been superseded by minimap2.
Questions
Can I run BWA online without installing it?
BWA is preinstalled on the machine behind every research conversation. Ask the agent in plain language, or give it the exact command — it runs it, reads the output and explains it.
What licence is BWA under?
BWA is published under its authors' own licence; the project page at https://github.com/lh3/bwa states it.
Which algorithm in BWA should be used for modern sequencing reads?
BWA-MEM is recommended for sequence reads longer than 70 base pairs, as it is faster, more accurate, and more error-tolerant than BWA-backtrack and BWA-SW. BWA-backtrack is intended for reads shorter than 70 base pairs.
Why does a single read appear multiple times in the SAM output?
BWA-MEM and BWA-SW perform local alignments. If a read spans a structural breakpoint, gene fusion, or large deletion, it will generate multiple lines representing split hits, with one designated as the primary alignment and the remainder marked as supplementary.
Can BWA align reads against the GRCh38 reference genome with ALT contigs?
Yes, BWA-MEM supports GRCh38 with ALT contigs. While running without post-processing yields results similar to aligning against GRCh38 without ALT contigs, applying recommended post-processing reduces false mappings from diverged ALT regions and enables HLA typing.
Why does one read in a pair have a high mapping quality while its mate has zero?
Mapping quality is calculated for individual reads rather than read pairs. One read may match a unique genomic location, whereas its paired mate falls within a tandem repeat where its exact position cannot be determined.
What tools are replacing BWA?
For long-read sequencing data, BWA-MEM has been replaced by minimap2, and for short reads, it is planned to be replaced by minibwa.
How to cite it
Li H. (2013) Aligning sequence reads, clone sequences and assembly contigs with BWA-MEM. arXiv:1303.3997v2 [q-bio.GN].
Written from BWA's own README and project page. Statements citing a figure that does not appear there are removed before publication. Licence and running details come from our registry.