This is a test version of Biostars. For the public version, visit https://www.biostars.org.
BAM file and Bedgraph file don't match after bedtools genomecov?

Hello all,

I'm trying to convert an RNA-seq BAM file to a Bedgraph file, so that I can compare read coverage across different parts of each gene. I used STAR to align my RNA-seq data, and then the following command:

bedtools genomecov -bg -ibam input.bam > output.bedgraph

To convert my bam file to a bedgraph file. However, when I compare the bam file and the bedgraph file, it seems like something weird happens: 0 value regions in the BAM file suddenly have a positive value in the bedgraph value, and it isn't the same value every time either! Here's an IGV visualization illustrating the problem I'm having:

BamToBdgProblem

Does anyone have any idea what's going on?

bam rna-seq

1 answer

you should check if IGV is filtering any kind of reads. typically this is caused by IGV's default duplicate reads filtering.

just unselect everything you see under "View > Preferences > Alignments > Filter..." and you should see in IGV's coverage track the same profile than the Bedgraph has.

Log in to answer this question.