Both alignments have a flag of 4 which means "unaligned". So in terms of the way those alignments would be interpreted by any downstream tools they are unaligned. I don't know the details but things happen at different stages within BWA so at times their can be seemingly conflicting info in an alignment however the flag field is trustworthy.  I believe the SAM spec says if the flag is 4 you shouldn't trust any other fields. That appears to be good advise in this case.

On Jul 17, 2014 3:13 AM, "Cloelia Dard-Dascot" <cloelia.dard-dascot@cgm.cnrs-gif.fr> wrote:
Hi
i found out a weird behaving of BWA where it maps on the wrong part

Here my reads which cause the problem pb.fastq:
@M01342:47:000000000-A9VMJ:1:2110:28593:14009 1:N:0:1
ATCGGACCAGGCTTCATTCCC
+
CBCCCCCCCFCCGGGGGGGGG
@M01342:47:000000000-A9VMJ:1:2112:10072:14449 1:N:0:1
ATCGGACCAGGCTTCATTCCC
+
AAABABBBBFAAFGGGGGGGG

here is my reference genome brassica_pb.fa (actually they are micro RNA
but it should work also, right?)
 >bna-miR167c_MIMAT0005628_Brassica_napus_miR167c
TGAAGCTGCCAGCATGATCTA
 >bna-miR166a_MIMAT0005629_Brassica_napus_miR166a
TCGGACCAGGCTTCATTCCCC

here are my commands:
/home/ctuser/Documents/programmes/bwa-0.7.10/bwa index brassica_pb.fa
/home/ctuser/Documents/programmes/bwa-0.7.10/bwa aln -t 12 -n 0 -k 0
brassica_pb.fa pb.fastq > ./res_BWA_pb_newVersion/pb.sai
/home/ctuser/Documents/programmes/bwa-0.7.10/bwa samse brassica_pb.fa
./res_BWA_pb_newVersion/pb.sai $f > ./res_BWA_pb_newVersion/pb.sam

here is my sam file:
@SQ SN:bna-miR167c_MIMAT0005628_Brassica_napus_miR167c LN:21
@SQ SN:bna-miR166a_MIMAT0005629_Brassica_napus_miR166a LN:21
@PG ID:bwa PN:bwa VN:0.7.10-r789
CL:/home/ctuser/Documents/programmes/bwa-0.7.10/bwa samse brassica_pb.fa
./res_BWA_pb_newVersion/pb.sai pb.fastq
M01342:47:000000000-A9VMJ:1:2110:28593:14009 4
bna-miR167c_MIMAT0005628_Brassica_napus_miR167c 21 25 21M * 0 0
ATCGGACCAGGCTTCATTCCC CBCCCCCCCFCCGGGGGGGGG XT:A:U NM:i:0 X0:i:1 X1:i:0
XM:i:0 XO:i:0 XG:i:0 MD:Z:21
M01342:47:000000000-A9VMJ:1:2112:10072:14449 4
bna-miR167c_MIMAT0005628_Brassica_napus_miR167c 21 25 21M * 0 0
ATCGGACCAGGCTTCATTCCC AAABABBBBFAAFGGGGGGGG XT:A:U NM:i:0 X0:i:1 X1:i:0
XM:i:0 XO:i:0 XG:i:0 MD:Z:21

we can see that both of the reads have been mapped to the first mir but
it should not have been mapped at all (or maybe to the second mir but I
have put into parameter no mismatch)!!
I tried three different versions of BWA (0.7.5, 0.6.1 and 0.7.10) but
same behaviour.
Did I do something wrong?
I must say it usually work fine and found the right mir but for two
cases includind this one, it found the mir just before the right one. Is
there a problem of length?
Thank for any help



------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Bio-bwa-help mailing list
Bio-bwa-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bio-bwa-help