This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Difference between samtools DEPTH and MPILEUP

EDIT
I'm going to leave this here in case it is helpful, or someone has more up-to-date information to add. But I just did some smarter googling and found some similar questions with answers:
http://seqanswers.com/forums/showthread.php?t=17438
Should Samtools Pileup Be Performed On Uniquely Mapped Reads Or All The Reads?
Genomic Coverage - Samtool's undocumented "depth" verses the poorly documented pileup.
Discrepancy In Samtools Mpileup/Depth And Bedtools Genomecoveragebed Counts


Original Question
I'm doing ChIP-Seq analysis and want the read depth at each and every genome position aligned in a set of bam files, includign 0s for positions covered in one bam file but not another. Totally raw-no score filtering. Both depth and mpileup accept a list of bam files.

DEPTH

Computes the depth at each position or region. a -a, -aa: Output absolutely all positions, including unused reference sequences

MPILEUP

In the pileup format (without -u or -g), each line represents a genomic position, consisting of chromosome name, 1-based coordinate, reference base, the number of reads covering the site

It sounds like both sort of do what I'm looking for. But I'm a fairly green bioinformaticist, and I don't know if I'm missing something in the difference between "number of reads covering the site" (mpileup) and "depth" (depth). The mpileup docs go into a lot more details about the output format.

It seems like mpileup has more options and offers more detail than depth. For my purposes, is there a difference in 1) function or 2) performance?

samtools mpileup depth chip-seq reads

1 answer

If you just want the depth, then use samtools depth with the appropriate settings for no filtering (note that this will double count overlapping paired-end reads if you really do set -q to 0). Internally, depth and mpileup are using most of the same functions, it's mostly just a matter of what they output.

Log in to answer this question.