merge overlaps and remove non overlap genomic windows
1
0
Entering edit mode
28 days ago
reza ▴ 300

hi everyone

I have two bed files, How can I create a file from the two mentioned files that merges the overlaps and deletes the rest of the windows

for example

A.bed
Ch1 200 250
Ch1 260 300
Ch1 310 400
Ch1 480 500

B
Ch1 150 220
Ch1 311 420
Ch1 501 600
Ch1 601 650

desired output
Ch1 150 250
Ch1 310 420
Ch1 480 600
BED intersection overlap • 295 views
ADD COMMENT
0
Entering edit mode
28 days ago

have two bed files

these are not bed files. A chromosome is missing in chromosome 1

How can I create a file from the two mentioned files that merges the overlaps and deletes the rest of the windows

once there is a chromosome, use 'bedtools intersect -v'

-v  Only report those entries in A that have _no overlaps_ with B.
    - Similar to "grep -v" (an homage).
ADD COMMENT
0
Entering edit mode

sorry i edited my example. But your answer is exactly the opposite of what I want

ADD REPLY
0
Entering edit mode

But your answer is exactly the opposite of what I want

oh I see. but i don't understand the logic why:

"Ch1 200 250" and "Ch1 150 220" would return "Ch1 150 250" ?

ADD REPLY
0
Entering edit mode

Overlap of "Ch1 200 250" and "Ch1 150 220" is "Ch1 200 220", but I want to combine windows that have overlap. Thus, my goal is to combine these two windows and create "Ch1 150 250". I'm also going to skip windows that don't have overlaps.

English is not my native language and I may not be able to explain myself properly

ADD REPLY

Login before adding your answer.

Traffic: 1509 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6