This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to use bedtools coverage

Yes, I did RTFM, but I'm still not understanding. I have bed files with start and end coordinates for peaks. I've extended these by 100 on either side. I also have bam files of alignments across the whole genomes. I want the depth counts only under the extended peak regions. What would be the syntax for doing this with bedtools coverage?

As far as I can tell it would be:

bedtools coverage -a alignments.bam -b peaks.bed -d

Does that seem correct?

My goal is to have wig or bigwig tracks of the peaks to view in a genome browser such as IGV.

Note: I called the peaks with macs2, and I'm aware of the -w/--wig flag for giving results in wig format. That would be perfect except for wanting to extend my tracks on either side of the peaks.

Note2: Short of this working, I plan to take pileups from samtools depth and munge them into wig files.

I'm very open to hearing other/better ways to accomplish this.

chip-seq coverage depth bedtools

1 answer

You would want to swap the BAM and BED files, at least with recent versions of bedtools.

Log in to answer this question.