bwa(1)
π bwa(1) β Burrows-Wheeler Alignment Tool π
okay bestie, sit DOWN, because bwa(1) is the alignment tool and we're gonna go through the whole thing together. it's giving legendary. it's giving essential. no cap. π§¬β¨
π NAME π
bwa β Burrows-Wheeler Alignment Tool π¦
β¨ SYNOPSIS β¨
bestie. the whole vibe in six lines:
bwa index ref.fa
bwa mem ref.fa reads.fq > aln-se.sam
bwa mem ref.fa read1.fq read2.fq > aln-pe.sam
bwa aln ref.fa short_read.fq > aln_sa.sai
bwa samse ref.fa aln_sa.sai short_read.fq > aln-se.sam
bwa sampe ref.fa aln_sa1.sai aln_sa2.sai read1.fq read2.fq > aln-pe.sam
bwa bwasw ref.fa long_read.fq > aln.sam
likeβ¦ she does everything. main character energy fr. π
πΈ DESCRIPTION πΈ
BWA is a software package for mapping low-divergent sequences against a large reference genome, such as the human genome. yes, the human genome. iconic.
she's actually three algorithms in a trench coat:
- BWA-backtrack β designed for Illumina sequence reads up to
100bp - BWA-SW β for longer sequences,
70bpto1Mbp - BWA-MEM β also for longer sequences,
70bpto1Mbp
BWA-MEM and BWA-SW share similar features such as long-read support and split alignment, but BWA-MEM, which is the latest, is generally recommended for high-quality queries as it is faster and more accurate. periodt. π
BWA-MEM also has better performance than BWA-backtrack for 70-100bp Illumina reads.
For all the algorithms, BWA first needs to construct the FM-index for the reference genome (the index command). Alignment algorithms are invoked with different sub-commands:
aln/samse/sampeβ BWA-backtrackbwaswβ BWA-SWmemβ BWA-MEM
π COMMANDS AND OPTIONS π
π index
bwa index [-p prefix] [-a algoType] db.fa
Index database sequences in the FASTA format. (yes bestie, you gotta build the index before you do literally anything else. it's the prerequisites class you can't skip. π)
OPTIONS
-p STRβ Prefix of the output database [same as db filename]-a STRβ Algorithm for constructing BWT index. BWA implements three algorithms for BWT construction:is,bwtswandrb2.- The first algorithm (
is) is a little faster for small database but requires large RAM and does not work for databases with total length longer than2GB. - The second algorithm (
bwtsw) is adapted from the BWT-SW source code. It in theory works with database with trillions of bases. π€― - When this option is not specified, the appropriate algorithm will be chosen automatically. she just knows. π
- The first algorithm (
𧬠mem
bwa mem [-aCHjMpP] [-t nThreads] [-k minSeedLen] [-w bandWidth]
[-d zDropoff] [-r seedSplitRatio] [-c maxOcc] [-D chainShadow]
[-m maxMateSW] [-W minSeedMatch] [-A matchScore] [-B mmPenalty]
[-O gapOpenPen] [-E gapExtPen] [-L clipPen] [-U unpairPen] [-x readType]
[-R RGline] [-H HDlines] [-v verboseLevel] db.prefix reads.fq [mates.fq]
Align 70bp-1Mbp query sequences with the BWA-MEM algorithm. Briefly, the algorithm works by seeding alignments with maximal exact matches (MEMs) and then extending seeds with the affine-gap Smith-Waterman algorithm (SW). cute little pipeline, obsessed. β¨
If mates.fq file is absent and option -p is not set, this command regards input reads are single-end. If mates.fq is present, this command assumes the i-th read in reads.fq and the i-th read in mates.fq constitute a read pair. If -p is used, the command assumes the 2i-th and the (2i+1)-th read in reads.fq constitute a read pair (such input file is said to be interleaved). In this case, mates.fq is ignored. In the paired-end mode, the mem command will infer the read orientation and the insert size distribution from a batch of reads. she's figuring it out herself, bestie. π«Ά
The BWA-MEM algorithm performs local alignment. It may produce multiple primary alignments for different part of a query sequence. This is a crucial feature for long sequences. However, some tools may not work with split alignments. One may consider to use option -M to flag shorter split hits as secondary.
ALGORITHM OPTIONS
-t INTβ Number of threads [1]-k INTβ Minimum seed length. Matches shorter thanINTwill be missed. The alignment speed is usually insensitive to this value unless it significantly deviates from20. [19]-w INTβ Band width. Essentially, gaps longer thanINTwill not be found. Note that the maximum gap length is also affected by the scoring matrix and the hit length, not solely determined by this option. [100]-d INTβ Off-diagonal X-dropoff (Z-dropoff). Stop extension when the difference between the best and the current extension score is above|i-j|*A+INT, whereiandjare the current positions of the query and reference, respectively, andAis the matching score. Z-dropoff is similar to BLAST's X-dropoff except that it doesn't penalize gaps in one of the sequences in the alignment. Z-dropoff not only avoids unnecessary extension, but also reduces poor alignments inside a long good alignment. [100]-r FLOATβ Trigger re-seeding for a MEM longer thanminSeedLen*FLOAT. This is a key heuristic parameter for tuning the performance. Larger value yields fewer seeds, which leads to faster alignment speed but lower accuracy. [1.5]-c INTβ Discard a MEM if it has more thanINToccurrence in the genome. This is an insensitive parameter. [500]-D FLOATβ Drop chains shorter thanFLOATfraction of the longest overlapping chain [0.5]-m INTβ Perform at mostINTrounds of mate-SW [50]-W INTβ Drop a chain if the number of bases in seeds is smaller thanINT. This option is primarily used for longer contigs/reads. When positive, it also affects seed filtering. [0]-Pβ In the paired-end mode, perform SW to rescue missing hits only but do not try to find hits that fit a proper pair.
SCORING OPTIONS
-A INTβ Matching score. [1]-B INTβ Mismatch penalty. The sequence error rate is approximately:{.75 * exp[-log(4) * B/A]}. [4]-O INT[,INT]β Gap open penalty. If two numbers are specified, the first is the penalty of opening a deletion and the second for opening an insertion. [6]-E INT[,INT]β Gap extension penalty. If two numbers are specified, the first is the penalty of extending a deletion and second for extending an insertion. A gap of lengthkcostsO + k*E(i.e.-Ois for opening a zero-length gap). [1]-L INT[,INT]β Clipping penalty. When performing SW extension, BWA-MEM keeps track of the best score reaching the end of query. If this score is larger than the best SW score minus the clipping penalty, clipping will not be applied. Note that in this case, the SAMAStag reports the best SW score; clipping penalty is not deduced. If two numbers are provided, the first is for 5'-end clipping and second for 3'-end clipping. [5]-U INTβ Penalty for an unpaired read pair. BWA-MEM scores an unpaired read pair asscoreRead1+scoreRead2-INTand scores a paired asscoreRead1+scoreRead2-insertPenalty. It compares these two scores to determine whether we should force pairing. A larger value leads to more aggressive read pair. [17]-x STRβ Read type. Changes multiple parameters unless overridden [null]pacbio:-k17 -W40 -r10 -A1 -B1 -O1 -E1 -L0(PacBio reads to ref)ont2d:-k14 -W20 -r10 -A1 -B1 -O1 -E1 -L0(Oxford Nanopore 2D-reads to ref)intractg:-B9 -O16 -L5(intra-species contigs to ref)
INPUT/OUTPUT OPTIONS
-pβ Smart pairing. If two adjacent reads have the same name, they are considered to form a read pair. This way, paired-end and single-end reads can be mixed in a single FASTA/Q stream. slay. π-R STRβ Complete read group header line.'\t'can be used inSTRand will be converted to a TAB in the output SAM. The read group ID will be attached to every read in the output. An example is'@RG\tID:foo\tSM:bar'. [null]-H ARGβ IfARGstarts with@, it is interpreted as a string and gets inserted into the output SAM header; otherwise,ARGis interpreted as a file with all lines starting with@in the file inserted into the SAM header. [null]-o FILEβ Write the output SAM file toFILE. For compatibility with other BWA commands, this option may also be given as-f FILE. [standard output]-qβ Don't reduce the mapping quality of split alignment of lower alignment score.-5β For split alignment, mark the segment with the smallest coordinate as the primary. It automatically applies option-qas well. This option may help some Hi-C pipelines. By default, BWA-MEM marks highest scoring segment as primary.-K INTβ ProcessINTinput bases in each batch regardless of the number of threads in use [10000000*nThreads]. By default, the batch size is proportional to the number of threads in use. Because the inferred insert size distribution slightly depends on the batch size, using different number of threads may produce different output. Specifying this option helps reproducibility.-T INTβ Don't output alignment with score lower thanINT. This option affects output and occasionally SAM flag2. [30]-jβ Treat ALT contigs as part of the primary assembly (i.e. ignore thedb.prefix.altfile).-h INT[,INT2]β If a query has not more thanINThits with score higher than80%of the best hit, output them all in theXAtag. IfINT2is specified, BWA-MEM outputs up toINT2hits if the list contains a hit to an ALT contig. [5,200]-aβ spill ALL the alignments it found for single-end reads (or unpaired paired-end reads). Every one of those extra alignments gets flagged as a secondary alignment, so bestie, don't get confused when your SAM file suddenly has more lines π-Cβ append the FASTA/Q comment straight into the SAM output π. This is your girl for shoving read meta info (barcodes, hi bestie π) into SAM. But heads up: that comment β the string that lives after a space in the header line β has to follow the SAM spec, likeBC:Z:CGTAC. Malformed comments = incorrect SAM output, no cap, and you will be sad π-Yβ use the soft clipping CIGAR operation for supplementary alignments. By default BWA-MEM does soft clipping for the primary alignment and hard clipping for supplementary ones, so this flips the supplementary vibe β¨-Mβ mark shorter split hits as secondary-v INTβ turn the verbosity dial of the output. Real talk: this option is not fully supported throughout all of BWA π. The dream:0= no output to stderr at all,1= errors only,2= warnings and errors,3= all normal messages,4or higher = debugging chaos. And when it's set to4, the output is not SAM. [3]-I FLOAT[,FLOAT[,INT[,INT]]]β tell it the mean, standard deviation (defaults to 10% of the mean if you skip it), max (defaults to 4 sigma from the mean if you skip it) and min (defaults to 4 sigma if you skip it) of the insert size distribution π§. Only applicable to the FR orientation. If you don't bother, BWA-MEM infers all these numbers and the pair orientations once it has enough reads. [inferred]
πΈ aln πΈ
bwa aln [-n maxDiff] [-o maxGapO] [-e maxGapE] [-d nDelTail] [-i
nIndelEnd] [-k maxSeedDiff] [-l seedLen] [-t nThrds] [-cRN] [-M
misMsc] [-O gapOsc] [-E gapEsc] [-q trimQual] <in.db.fasta>
<in.query.fq> > <out.sai>
Find the SA coordinates of the input reads π¦. Maximum maxSeedDiff differences are allowed in the first seedLen subsequence, and maximum maxDiff differences are allowed in the whole sequence.
OPTIONS:
-n NUMβ maximum edit distance. If the value is an INT, that's your literal number. If it's a FLOAT, it's the fraction of missing alignments assuming a 2% uniform base error rate, and the max edit distance gets automatically chosen per read length π . [0.04]-o INTβ maximum number of gap opens [1]-e INTβ maximum number of gap extensions. Set it to-1for k-difference mode (which disallows long gaps) [-1]-d INTβ disallow a long deletion within INT bp towards the 3'-end [16]-i INTβ disallow an indel within INT bp towards the ends [5]-l INTβ take the first INT subsequence as the seed. If INT is bigger than the query sequence, seeding gets disabled entirely π«Ά. For long reads this is typically ranged from 25 to 35 when you're using-k 2. [inf]-k INTβ maximum edit distance in the seed [2]-t INTβ number of threads (multi-threading mode) [1]-M INTβ mismatch penalty. BWA will not search for suboptimal hits with a score lower than(bestScore-misMsc). [3]-O INTβ gap open penalty [11]-E INTβ gap extension penalty [4]-R INTβ proceed with suboptimal alignments if there are no more than INT equally best hits. This one only affects paired-end mapping. Raising the threshold improves pairing accuracy at the cost of speed, especially for short reads (~32bp) π-cβ reverse the query but do not complement it, which is required for alignment in the color space. (Disabled since 0.6.x) π-Nβ disable iterative search. All hits with no more thanmaxDiffdifferences will be found. This mode is much slower than the default, just so you know π₯-q INTβ parameter for read trimming. BWA trims a read down toargmax_x{\sum_{i=x+1}^l(INT-q_i)} if q_l<INTwhere l is the original read length. [0]-Iβ the input is in the Illumina 1.3+ read format (quality equals ASCII-64)-B INTβ length of barcode starting from the 5'-end. When INT is positive, the barcode of each read gets trimmed before mapping and written at the BC SAM tag. For paired-end reads, the barcodes from both ends are concatenated π. [0]-bβ declare that the input read sequence file is in BAM format. For paired-end data, the two ends of a pair must be grouped together, and-1or-2are usually applied to say which end should be mapped. Typical command lines for mapping paired-end data in BAM format look like this:
bwa aln ref.fa -b1 reads.bam > 1.sai
bwa aln ref.fa -b2 reads.bam > 2.sai
bwa sampe ref.fa 1.sai 2.sai reads.bam reads.bam > aln.sam
-0β when-bis specified, only use single-end reads in mapping-1β when-bis specified, only use the first read in a read pair in mapping (skips single-end reads and the second reads)-2β when-bis specified, only use the second read in a read pair in mapping
π samse π
bwa samse [-n maxOcc] <in.db.fasta> <in.sai> <in.fq> > <out.sam>
Generate alignments in the SAM format given single-end reads. Repetitive hits get chosen randomly π²
OPTIONS:
-n INTβ maximum number of alignments to output in the XA tag for reads paired properly. If a read has more than INT hits, the XA tag just won't be written. [3]-r STRβ specify the read group, in a format like@RG\tID:foo\tSM:bar. [null]
π sampe π
bwa sampe [-a maxInsSize] [-o maxOcc] [-n maxHitPaired] [-N
maxHitDis] [-P] <in.db.fasta> <in1.sai> <in2.sai> <in1.fq>
<in2.fq> > <out.sam>
Generate alignments in the SAM format given paired-end reads. Repetitive read pairs get placed randomly π²
OPTIONS:
-a INTβ maximum insert size for a read pair to be considered properly mapped. Since 0.4.5 this option is only used when there aren't enough good alignments to infer the distribution of insert sizes. [500]-o INTβ maximum occurrences of a read for pairing. A read with more occurrences gets treated as a single-end read. Lowering this parameter helps pairing go faster πββοΈ. [100000]-Pβ load the entire FM-index into memory to reduce disk operations (base-space reads only). With this option you need at least1.25Nbytes of memory, where N is the length of the genome. Plan accordingly bestie π§-n INTβ maximum number of alignments to output in the XA tag for reads paired properly. If a read has more than INT hits, the XA tag won't be written. [3]-N INTβ maximum number of alignments to output in the XA tag for disconcordant read pairs (singletons excluded). If a read has more than INT hits, the XA tag won't be written. [10]-r STRβ specify the read group, in a format like@RG\tID:foo\tSM:bar. [null]
π¦ bwasw π¦
bwa bwasw [-a matchScore] [-b mmPen] [-q gapOpenPen] [-r
gapExtPen] [-t nThreads] [-w bandWidth] [-T thres] [-s hspIntv]
[-z zBest] [-N nHspRev] [-c thresCoef] <in.db.fasta> <in.fq>
[mate.fq]
Align query sequences in the in.fq file. When mate.fq is present, it performs paired-end alignment. Fair warning: the paired-end mode only works for reads from Illumina short-insert libraries π. In paired-end mode, BWA-SW may still output split alignments, but they're all marked as not properly paired; the mate positions won't be written if the mate has multiple local hits.
OPTIONS:
-a INTβ score of a match [1]-b INTβ mismatch penalty [3]-q INTβ gap open penalty [5]-r INTβ gap extension penalty. The penalty for a contiguous gap of size k isq+k*r. [2]-t INTβ number of threads in the multi-threading mode [1]-w INTβ band width in the banded alignment [33]-T INTβ minimum score threshold divided by a [37]-c FLOATβ coefficient for threshold adjustment according to query length. Given an l-long query, the threshold for a hit to be retained isa*max{T,c*log(l)}. [5.5]-z INTβ Z-best heuristics. Higher-zincreases accuracy at the cost of speed β‘ [1]-s INTβ maximum SA interval size for initiating a seed. Higher-sincreases accuracy at the cost of speed β‘ [3]-N INTβ minimum number of seeds supporting the resultant alignment to skip reverse alignment. [5]
πΈ SAM ALIGNMENT FORMAT πΈ
okay bestie so listen β the output of the aln command is binary and it's literally only meant for BWA's own eyeballs π
. BWA outputs the final alignment in the SAM (Sequence Alignment/Map) format, and every line is built out of these eleven-plus-one pieces:
1βQNAMEβ Query (pair) NAME2βFLAGβ bitwise FLAG3βRNAMEβ Reference sequence NAME4βPOSβ 1-based leftmost POSition/coordinate of clipped sequence5βMAPQβ MAPping Quality (Phred-scaled)6βCIAGRβ extended CIGAR string7βMRNMβ Mate Reference sequence NaMe (=if same as RNAME)8βMPOSβ 1-based Mate POSistion9βISIZEβ Inferred insert SIZE10βSEQβ query SEQuence on the same strand as the reference11βQUALβ query QUALity (ASCII-33 gives the Phred base quality)12βOPTβ variable OPTional fields in the formatTAG:VTYPE:VALUE
π the FLAG field, bit by bit π
every single bit in that FLAG field means something, and here's the whole lineup:
p/0x0001β the read is paired in sequencingP/0x0002β the read is mapped in a proper pairu/0x0004β the query sequence itself is unmappedU/0x0008β the mate is unmappedr/0x0010β strand of the query (1 for reverse)R/0x0020β strand of the mate1/0x0040β the read is the first read in a pair2/0x0080β the read is the second read in a pairs/0x0100β the alignment is not primaryf/0x0200β QC failured/0x0400β optical or PCR duplicateS/0x0800β supplementary alignment
Please check <http://samtools.sourceforge.net> for the format specification and the tools for post-processing the alignment π
BWA also generates the following optional fields, and heads up β tags starting with X are specific to BWA:
NMβ Edit distanceMDβ Mismatching positions/basesASβ Alignment scoreBCβ Barcode sequenceSAβ Supplementary alignmentsX0β Number of best hitsX1β Number of suboptimal hits found by BWAXNβ Number of ambiguous bases in the refereneceXMβ Number of mismatches in the alignmentXOβ Number of gap opensXGβ Number of gap extensionsXTβ Type: Unique/Repeat/N/Mate-swXAβ Alternative hits; format:/(chr,pos,CIGAR,NM;)*/XSβ Suboptimal alignment scoreXFβ Support from forward/reverse alignmentXEβ Number of supporting seeds
quick note bestie π«Ά βXOandXGare generated by BWT search, while the CIGAR string comes from Smith-Waterman alignment. These two tags may be inconsistent with the CIGAR string. This is not a bug. periodt.
π¦ NOTES ON SHORT-READ ALIGNMENT π¦
β¨ Alignment Accuracy β¨
When seeding is disabled, BWA guarantees it'll find an alignment containing a maximum of maxDiff differences, including maxGapO gap opens which do not occur within nIndelEnd bp towards either end of the query. Longer gaps may be found if maxGapE is positive, but it's not guaranteed to find all hits π. When seeding is enabled, BWA further requires that the first seedLen subsequence contains no more than maxSeedDiff differences.
When gapped alignment is disabled, BWA is expected to generate the same alignment as Eland version 1, the Illumina alignment program. However β and this is the tea β since BWA changes N in the database sequence to random nucleotides, hits to these random sequences will also get counted. So as a consequence, BWA may mark a unique hit as a repeat, if those random sequences happen to be identical to the sequences which should be unique in the database π
By default, if the best hit is not highly repetitive (this is controlled by -R), BWA also finds all hits containing one more mismatch; otherwise, BWA finds all equally best hits only. Base quality is NOT considered in evaluating hits. In paired-end mode, BWA pairs all the hits it found. It further performs Smith-Waterman alignment for unmapped reads to rescue reads with a high error rate, and for high-quality anomalous pairs to fix potential alignment errors. so much going on fr fr π
β¨ Estimating Insert Size Distribution β¨
BWA estimates the insert size distribution per 256*1024 read pairs. First it collects pairs of reads with both ends mapped with a single-end quality 20 or higher, then it calculates the median (Q2), and the lower and higher quartile (Q1 and Q3). It estimates the mean and the variance of the insert size distribution from pairs whose insert sizes fall within the interval [Q1-2(Q3-Q1), Q3+2(Q3-Q1)].
The maximum distance x for a pair considered to be properly paired (SAM flag 0x2) is calculated by solving the equation
Phi((x-mu)/sigma)=x/L*p0
where mu is the mean, sigma is the standard error of the insert size distribution, L is the length of the genome, p0 is the prior of an anomalous pair, and Phi() is the standard cumulative distribution function. For mapping Illumina short-insert reads to the human genome, x is about 6-7 sigma away from the mean. Quartiles, mean, variance and x will all be printed to the standard error output πβ¨
β¨ Memory Requirement β¨
With the bwtsw algorithm, 5GB of memory is required for indexing the complete human genome sequences. For short reads, the aln command uses ~3.2GB memory and the sampe command uses ~5.4GB. your laptop is gonna be fighting for its life bestie π
β¨ Speed β¨
Indexing the human genome sequences takes 3 hours with the bwtsw algorithm. Indexing smaller genomes with the IS algorithms is faster, but requires more memory.
The speed of alignment is largely determined by the error rate of the query sequences (r). Firstly, BWA runs much faster for near-perfect hits than for hits with many differences, and it stops searching for a hit with l+2 differences if an l-difference hit is found. This means BWA will be very slow if r is high, because in that case BWA has to visit hits with many differences and looking for these hits is expensive π Secondly, the alignment algorithm behind it makes the speed sensitive to [k log(N)/m], where k is the maximum allowed differences, N the size of the database and m the length of a query. In practice, we choose k with respect to r, and therefore r is the leading factor. I would not recommend using BWA on data with r>0.02.
Pairing is slower for shorter reads. This is mainly because shorter reads have more spurious hits, and converting SA coordinates to chromosomal coordinates is very costly πΈ
π CHANGES IN BWA-0.6 π
Since version 0.6, BWA has been able to work with a reference genome longer than 4GB. This feature makes it possible to integrate the forward and reverse complemented genome in one FM-index, which speeds up both BWA-short and BWA-SW. As a tradeoff, BWA uses more memory because it has to keep all positions and ranks in 64-bit integers β twice as large as the 32-bit integers used in the previous versions. the price of greatness π
The latest BWA-SW also works for paired-end reads longer than 100bp. In comparison to BWA-short, BWA-SW tends to be more accurate for highly unique reads and more robust to relatively long INDELs and structural variants. Nonetheless, BWA-short usually has higher power to distinguish the optimal hit from many suboptimal hits. The choice of the mapping algorithm may depend on the application π
π SEE ALSO π
- BWA website β
http://bio-bwa.sourceforge.net - Samtools website β
http://samtools.sourceforge.net
π AUTHOR π
Heng Li at the Sanger Institute wrote the key source codes and integrated the following codes for BWT construction:
bwtswβhttp://i.cs.hku.hk/~ckwong3/bwtsw/, implemented by Chi-Kwong Wong at the University of Hong KongISβhttp://yuta.256.googlepages.com/sais, originally proposed by Nong Ge (http://www.cs.sysu.edu.cn/nong/) at the Sun Yat-Sen University and implemented by Yuta Mori
π LICENSE AND CITATION π
okay bestie, legal tea time β but like, the fun kind where you also get told exactly who to cite so you don't get dragged in the replies π
The full BWA package is distributed under GPLv3, because it uses source codes from BWT-SW, which is itself covered by GPL. So yeah, GPL energy travels π«Ά
But the sorting, hash table, BWT and IS libraries? Those are distributed under the MIT license. Two licenses, one repo, iconic honestly π
β¨ the citation receipts β¨
bestie, if you use a thing, you CITE the thing. this is not optional, this is the vibe check of academia π
If you use the BWA-backtrack algorithm, please cite the following paper:
Li H. and Durbin R. (2009) Fast and accurate short read alignment with
Burrows-Wheeler transform. Bioinformatics, 25, 1754-1760. [PMID:
19451168]
If you use the BWA-SW algorithm, please cite:
Li H. and Durbin R. (2010) Fast and accurate long-read alignment with
Burrows-Wheeler transform. Bioinformatics, 26, 589-595. [PMID: 20080505]
If you use BWA-MEM or the fastmap component of BWA, please cite:
Li H. (2013) Aligning sequence reads, clone sequences and assembly
contigs with BWA-MEM. arXiv:1303.3997v1 [q-bio.GN].
And the sad little footnote to all this π β it is likely that the BWA-MEM manuscript will not appear in a peer-reviewed journal. So the arXiv one is the one, fr fr.
πΈ HISTORY πΈ
okay so, storytime, because this software has lore πβ¨
BWA is largely influenced by BWT-SW. Like, it uses source codes from BWT-SW and mimics its binary file formats, and BWA-SW resembles BWT-SW in several ways. The initial idea about BWT-based alignment also came from the group who developed BWT-SW. π«Ά
But β and this is the important part β BWA is different enough from BWT-SW. The short-read alignment algorithm bears no similarity to the Smith-Waterman algorithm any more. And while BWA-SW learns from BWT-SW, it introduces heuristics that can hardly be applied to the original algorithm. So:
In all, BWA does not guarantee to find all local hits as what BWT-SW is designed to do, but it is much faster than BWT-SW on both short and long query sequences. β‘
So likeβ¦ tradeoff. Not the same promise, way more speed. That's the deal π
π°οΈ the timeline, bestie π°οΈ
- The first piece of codes started getting written on 24 May 2008 βοΈ
- The initial stable version dropped on 02 June 2008 π
- During that period, the author got acquainted that Professor Tak-Wah Lam, the first author of the BWT-SW paper, was collaborating with Beijing Genomics Institute on SOAP2 β the successor to SOAP (Short Oligonucleotide Analysis Package)
- SOAP2 came out in November 2008
- According to the SourceForge download page, the third BWT-based short read aligner, bowtie, was first released in August 2008 π
- And at the time of writing this manual, at least three more BWT-based short-read aligners are being implemented. the girlies were BUSY π
π the algorithms' glow-ups π
BWA-SW is a new component of BWA. It was conceived in November 2008 and implemented ten months later. patience is a virtue, lowkey π§
BWA-MEM is based on an algorithm finding super-maximal exact matches (SMEMs), which was first published with the fermi assembler paper in 2012 β¨ The basic SMEM algorithm was first implemented in the fastmap command for an experiment, and then the basic algorithm got extended and the extension part got added in Feburary 2013 to make BWA-MEM a fully featured mapper π
(yes, "Feburary". we keep the typo. the typo is canon. periodt π )
and that's the whole page, bestie π«Ά this was bwa-0.7.19-r1273, dated 22 March 2025 β go forth and align, you absolute icon ππ
π¦ where this page comes from
- ubuntu resolute: bwa 0.7.19-1 Β· MIT
- ubuntu stonking: bwa 0.7.19-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms