Hey all :]
I use samtools's depth, and occasionally samtool's pileup commands to calculate coverage of my reads to the genome before binning for coverage. I'm pretty sure everyone else does too ;)
One very common problem is that people find "samtools depth" and "samtools mpileup" don't match up - and it's commonly attributed to filtering poor quality reads, duplicates, etc (mpileup doing more filtering).
But there's a ton of other questions I just can't get the answers too from the sametools docs, namely:
Does depth/pileup count the region between a paired reads, or just the reads themselves?
Does samtools depth/pileup count singletons in paired end sequencing? Does it extrapolate based on average read length to fillout the whole fragment?
If a read maps to multiple locations, is it counted multiple times?
I'm working with ChIP-Seq data, so i might have to correct for peak-shift. What do you guys think?
Thanks! :)
A million thanks Devon for setting the record straight! I'm REALLY surprised that it only counts the reads themselves for the pileup - we have always used this for ALL our ChIP-Seq coverage plots, and I guess it's totally wrong! :O I mean, it depends what you're looking for I suppose - but like you say, it's about time I started writing my own scripts so I really know what's going on. I also work a lot with DNAse-Seq data, and there the 5' read is the most important (as that's where the DNAse actually cuts). I think it's time I made a depth tool for my specific applications. Thank you very much for the advise and clarity :)
Did you fix this problem? I met this problem too. I find the depth of mpileup is far less than samtools depth? I check it again and again and didn't find the answer. And I find PileOMeth might invoke mpileup and count the methylation and non-methylation reads and then calculated the methylation ratio. I don't use C, neither C++. For these question, what I can do is email the authors. LoL
Well Devon is the author so you're half way there :P
As you likely noted in another thread, mpileup is doing some filtering that depth isn't doing. Regarding PileOMeth, it does filtering to, but its defaults are somewhat different from the standard "samtools mpileup", though they work the same way and use the same API. You can play with the
-q
and-p
(these are identical to-q
and-Q
insamtools mpileup
andsamtools depth
) options to tweak things to your liking, though I should warn that I chose those because I find them to be the most useful.