I'm using bwa to align reads, and I have to choose the indexing method to use. The documentation says to use -a is for small genomes, and -a bwtsw for large genomes. I've used is, but sometimes this will crash with a segmentation fault, and bwtsw seems to work. Surely there is a better way to decide this than by trial and error? At what size is a genome "large", meaning I should use bwtsw? What is really the difference here?
2 answers
It's not documented online as far as I can tell, but bwa 0.6.2 will choose the correct method automatically if you don't specify an algorithm.
The command line help hints at this:
Usage: bwa index [-a bwtsw|is] [-c] <in.fasta>
Options: -a STR BWT construction algorithm: bwtsw or is [auto]
Looking in the code, the decision is made by looking at the size of the reference genome:
// simplified sample from bwtindex.c:
if (algo_type == "auto") {
if (l_pac > 50000000)
algo_type = "bwtsw";
else
algo_type = "is";
}
I believe l_pac is the total number of bases in the reference (but the code is pretty dense so I'm not positive).
Log in to answer this question.