This is a test version of Biostars. For the public version, visit https://www.biostars.org.
partition single bed file into non-overlapping regions

Hi,

I have a bed file with overlapping regions. Say:

chr1    100 300
chr1    200 300
chr1    500 800
chr1    700 900

I would like to create a new bed file with regions that do not have any overlaps but still contain the same exact coordinates. This is the desired output:

chr1    100 200
chr1    200 300
chr1    500 700
chr1    700 800
chr1    800 900

Is there a common tool for this?

bedops bed bedtools

1 answer

It's as easy as bedops --partition your.bed.

https://bedops.readthedocs.io/en/latest/

Thanks. I got confused by the output and mistakenly thought it was not what I wanted.

Log in to answer this question.