This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Bwa - Why Giving Only One Match Per Read ?

I am doing experiments with BWA and BowTie. Now, I am finding alignments using command:

./bwa aln -n 0 -k 41 database.fa SRR4493095_1.fastq > aln_sa.sai

and

./bwa samse database .fa aln_sa.sai SRR4493095_1.fastq > out_sa.sam

However, while BowTie gives 123 number of matches for 100 reads, BWA gives just 100 number of matches (one for each, does not reporting if match in another position found). Can anybody help me why is this happening and how to solve this ? I give -n 0 option because, I want to find matching allowing no mismatch.

Thanks in advance.

bwa genome

1 answer

I've just answered your question on the bio-bwa-help mailing list... when you could have taken the time to search for your answer here: http://www.biostars.org/post/show/45430/how-to-force-bwa-samse-to-output-multiple-hits-in-sam-format

Can you help me, I try to solve this issue by using command:

./bwa samse -n 1000 database.fa aln_sa.sai SRR4493095_1.fastq | xa2multi.pl  > out.sam

Though xa2multi.pl is located on the folder but it says xa2multi.pl : command not found

search for the 256 bit flag in the SAM/BAM

samtools view -f 0x0100 out_sa.sam

From the SAM specification, the 256 bit (0x0100 in hexadecimal) is set when the alignment is non primary, which happens when a read maps to two locations.

You need to make sure that you can execute your perl script properly. Specify the perl interpreter, or alternatively make sure the perl script is executable (chmod +x xa2multi.pl).

./bwa samse -n 1000 database.fa aln_sa.sai SRR4493095_1.fastq | perl xa2multi.pl  > out.sam

Thanks a lot. This works fine. Problem solved. Thanks to all of you.

Log in to answer this question.