This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Getting Bowtie2 or BWA to output more than one top alignment (not just a random one)

I want to find multi-mapped reads in my data. In general, if a read maps to multiple positions with the same mapping score, I want the aligner to output all the alignments that fall into this category whether this is 2 or 20.

Looking into this, the Bowtie2 manual says that it picks a random top alignment to output. BWA seems to do the same. Bowtie2 has the -k option to specify how many alignments to produce but does not guarantee that these are the best alignments. In other words, if I do -k 3 it will just output the first 3 alignments it finds. It doesn't go through the allotted number of iterations to find the "best" ones like it does in default. On the other hand, there is the -a option which will output all of the alignments it finds within that allotment of iterations. If I choose this, the output file will be massive. Did I understand these descriptions correctly? If so, is my only option to use -a and have a massive output? Is this possible in BWA instead? I haven't been able to find a solution there either.

alignment

1 answer

You can control it using bwa aln -> bwa sampe.

-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 will not be written. [3] -N INT Maximum number of alignments to output in the XA tag for disconcordant read pairs (excluding singletons). If a read has more than INT hits, the XA tag will not be written. [10]

Log in to answer this question.