Entering edit mode
7.4 years ago
george
•
0
I want to get the number of each covering each position in the genome using samtools. I used samtools depth, mpileup and view and they all give different results. I tried with different versions of samtools (0.1.1 and 1.6) and using different options, but the results don't match. Is there something that I am missing?
samtools depth file.bam -aa -q 0 -Q 0 | head
chr 1 1083
chr 2 1349
chr 3 1485
chr 4 1669
chr 5 1789
chr 6 1834
chr 7 2137
chr 8 2318
chr 9 2402
chr 10 2762
samtools mpileup file.com -aa -q 0 -Q 0 -f genome.fas | head | cut -f1,2,4
chr 1 T 1081
chr 2 T 1347
chr 3 A 1483
chr 4 A 1667
chr 5 A 1787
chr 6 A 1832
chr 7 C 2135
chr 8 A 2316
chr 9 G 2410
chr 10 C 2765
samtools view file.bam chr:0-1 -c
2947
What about the difference between depth and mpileup. These two use similar/same functions and you expect those results to be the same
not the same filters, you will find things related to PROPER_PAIR : https://github.com/samtools/samtools/blob/master/bam_plcmd.c#L282
see all under: https://github.com/samtools/samtools/blob/master/bam_plcmd.c#L229