I saw lot of record with perfect alignment (150M) but marked as secondary alignment in SAM file. For example those with FLAG number 339 or 419. The following one for example:
E00477:134:H2H2NCCXx:6:2203:29267:71384 419 chr1 14479 3 150M = 14705 376 GTGGAGCCGTCCCCCCATGGAGCACAGGCAGACAGAAGTCCCCGCCCCAGCTGTGTGGCCTCAAGCCAGCCTTCCGCTCCTTGAAGCTGGTCTCCACACAGTGCTGGCTCCGTCACCCCCTCCCAAGGAAGTAGGTCTGAGCAGCTTGTC AAAFFK<AF<A<AFFFKFKFKKKKKKKK7FK<AKAA7AFKFKK<FFKKKKKKKAKKKKKKKF,,7AAFKAK,,<AFFKKK7,,<FKKKKFAK7AFF<,AFA7AAA<K(FKKKA,,<FFAK7AK(,AFAF7,,7AFF,,<AA77,<77FAA NH:i:2 HI:i:2 AS:i:296 nM:i:1
Why is that? Does that mean their corresponding primary alignment is also perfect and has higher base call quality? Any comments are appreciated!
furthermore, it's NOT perfect there is at least one mismatch
:nm:i:1
and there is another alignment for this read:NH:i:2
Thanks for responding. I checked again and found out that those record with mapping quality of 255 are all primary alignment. It seems to me that mapping quality is the most important determinant for this, right?
I didn't pay much attention on 'nm' tap earlier. But how comes 'nm' shows mismatch when 150M? I thought 150M means every base match for read of 150bp long
No.
https://samtools.github.io/hts-specs/SAMv1.pdf :
I forgot to mention that I was using STAR. I did some searching and it seems to me that MAPQ is different for different aligner. For STAR, 255 means uniquely mapped
no, see the SAM spec for the cigar operator 'M': https://samtools.github.io/hts-specs/SAMv1.pdf
which organism/build is it ?