Entering edit mode
3.4 years ago
eoneill627
▴
20
I have a bedgraph file with the chromosome, start and end point, and the coverage:
CM000994.3 10167710 10167711 95
CM000994.3 10167718 10167720 95
I want to merge regions that are close together.
With a bed file I could use something like this:
bedtools merge -d 1000 -i file.bed >file.merged.bed
Is there a similar thing for bedgraph files? I could convert to bed and then merge, but then I loose the information about coverage.
bedGraphs are BED files, and
bedtools merge
has options-c
and-o
which determine how it should summarize additional columns of overlapping regions, e.g. summing, averaging. Check the help section ofbedtools merge
.