I have a BED file that was engendered with the following:
bedtools makewindows -g ../bedtools2/genomes/human.hg19.genome -w 2000 > hg19_2K_bins.bed
The goal is to map reads from a BAM file to the intervals as defined, to visualize the distribution of the counts pan-genome, bin-wise. Now, I am aware of the bamCoverage tool from deeptools, but the incorrigible issue is that it merges adjacent bins if the count number overlaps.
bamCoverage --bam testMe.bam -o testMe_2k.bw --binSize 2000 --normalizeUsing None --effectiveGenomeSize 2913022398 # hg19 version of Homo sapiens --outFileFormat bedgraph --maxFragmentLength 30
The output I desire is something like:
Chrom Start End Score chr1 0 2000 34 chr1 2000 4000 46 ...
where the values in the last column (Score) are from our BAM file.
I have two questions, basically.
- Is there an alternative tool for this or a workaround?
- What if we have a bedgraph/ bw file with scores instead of a BAM?
Please advise. Thanks.