This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Finding difference in read depth between two BAM files

Hello,

I am looking to find the difference in read depth between two bam files (A, B.) My initial idea was to use Bedtools, find the total coverage of A and B, and then use Bedtools intersect to compare where they overlap and do not. However, I'm just curious if anybody has alternative suggestions or better software tools to use.

sequencing bam bedtools

What data it is ? ChIP ? WGS ? RNA ?

2 answers

using samtools mpileup and two bam files:

samtools mpileup -f ref.fasta in1.bam in2.bam | cut -f 1,2,4,7

1   101766  19  29
1   101767  19  30
1   101768  19  29
1   101769  123 188
1   101770  122 187
1   101771  122 189
1   101772  122 189

output is : chrom/pos/depth-bam1/depth-bam2

There are a few methods....

  • genomeCoverageBedtools
  • samtools depth
  • deeptools bamcoverage
  • Rsamtools

Log in to answer this question.