How does bamCoverage calculate coverage within a bin?

483 views
Skip to first unread message

aire...@gmail.com

unread,
Sep 3, 2015, 5:13:46 PM9/3/15
to deepTools
Hi,

I was trying to use bamCoverage to normalize my sequencing data, but I would like to know how this program calculate the coverage in each bin. Does it adding up all reads that mapped to the bin? And when I try normalize to 1x, will it take bin values first than normalize or bin the results after normalization? Actually when using different bin size, the results are a little confusing to me.

I use commands like this:
bamcoverage --normalizeTo1x 4641652 --fragmentLength 300 --outFileFormat bedgraph --binSize 50 -o XXX.bg -b XXX.bam

My data is pair-end, read length 150, fragment length ~300

When I use 50 as bin size, most bins have values around 1 and the median is about 1, which I think is as expected.
But, when I use 200 as bin size, the median goes up to 1.5
When I use 500 as bin size, the median is about 2.5.

Can someone explain this? Thank you in advance!

Aireen

Fidel Ramirez

unread,
Sep 15, 2015, 11:50:16 AM9/15/15
to aire...@gmail.com, deepTools
Hi Aireen,

I was not around. Sorry for the late reply.

The way the normalisation is achieved is by first determining the actual read coverage (number of mapped reads * fragment length) / effective genome size. And using this number to determine the scaling factor that would yield a 1x coverage.

Then, for each bin the coverage is computed after extending the reads. Then the scaling factor applied per bin.

What I think is happening is that once you have bins that are larger and larger the actual coverage is different than the one initially computed. Maybe a better strategy would be to first compute the exact coverage and then apply the scaling factor.  I will add an issue on this on github.

Best,

Fidel


--
You received this message because you are subscribed to the Google Groups "deepTools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deeptools+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Fidel Ramirez

Reply all
Reply to author
Forward
0 new messages