Entering edit mode
5 months 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
sorry i edited my example. 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" ?
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