What it does
This tool calculates the genome-wide coverage of intervals defined in a BAM or BED file and reports them in BedGraph format.
The input BED or BAM file must be sorted by chromosome name (but doesn't necessarily have to be sorted by start position).
This tool requires that bedtools has been installed on your system.
Example 1
Input (BED format)- Overlapping, un-sorted intervals:
chr1 140 176 chr1 100 130 chr1 120 147
Output (BedGraph format)- Sorted, non-overlapping intervals, with coverage value on the 4th column:
chr1 100 120 1 chr1 120 130 2 chr1 130 140 1 chr1 140 147 2 chr1 147 176 1
Example 2 - with ZERO-Regions selected (assuming hg19)
Input (BED format)- Overlapping, un-sorted intervals:
chr1 140 176 chr1 100 130 chr1 120 147
Output (BedGraph format)- Sorted, non-overlapping intervals, with coverage value on the 4th column:
chr1 0 100 0 chr1 100 120 1 chr1 120 130 2 chr1 130 140 1 chr1 140 147 2 chr1 147 176 1 chr1 176 249250621 0
This tool is part of the bedtools package from the Quinlan laboratory. If you use this tool, please cite Quinlan AR, and Hall I.M. BEDTools: A flexible framework for comparing genomic features. Bioinformatics, 2010, 26, 6.