Friday, September 24, 2010

Interpreting samtools flagstat output

I get the following output from running running the flagstat command in samtools for one particular bam file:

22283920 in total

0 QC failure

0 duplicates

20536595 mapped (92.16%)

22283920 paired in sequencing

11141960 read1

11141960 read2

17996862 properly paired (80.76%)

19980715 with itself and mate mapped

555880 singletons (2.49%)

852545 with mate mapped to a different chr

92547 with mate mapped to a different chr (mapQ>=5)

I am not sure what the 8th and 9th lines mean:

line 8: 17996862 properly paired (80.76%)

line 9: 19980715 with itself and mate mapped

I would have thought (looking at line 8 alone), that this means that 17996862 of the 20536595 mapped tags are "properly" (on the same chr, within the limits of the allowed insert size and same(?) orientation) paired with their mate. But I have no idea what line 9 means. Any help would be greatly appreciated!

Thanks

samtools flagstat output interpretation description
asked Jun 17 at 15:31

sasseq
16●3
One Answer: oldestnewestmost voted
2
At the risk of being overly technical, line 8, "properly paired", simply means the properly paired flag is set - it is entirely up to the program writing it to define "proper". Generally, this is set by an aligner to indicate what you describe, same chr, opposite orientation, and a within few deviations from the expected insert size. But this varies depending on the aligner used.

Line 9, means that both the forward and reverse are mapped -- somewhere, anywhere. Properly paired is a subset of these reads. You'll also find that the total of line 9 and the read pairs in which only one tag is successfully mapped (singletons) is equal to the total mapped reads. 19980715 (both mapped) + 555880 (singletons) = 20536595 (total mapped reads).

Lastly, since the sum of "proper pairs" and "itself and mate mapped to different chr" is less than "itself and mate mapped", it appears your aligner does require additional directionality or distance constraints for a "proper pair".

~J

answered Jun 22 at 10:24

jmanning2k
171●11

No comments: