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:
Does anyone have any idea what's going on?