Combining two BED files based on shared criteria
0
0
Entering edit mode
5.0 years ago
rbronste ▴ 420

I have a somewhat tricky BED file convergence that I need to produce, well tricky for me anyway.

The first set of intervals looks as follows:

chr1    5022835 5023172   sorted_merged_peak_1  867 
chr1    7088778 7088978   sorted_merged_peak_2  1041        
chr1    36710020 36710149 sorted_merged_peak_3  805

The second set of intervals contains single bp stretches that fall within the boundaries of those in the first set:

    chr1    5022838 5022839
    chr1    7088780 7088781
    chr1    36710022 36710023

The output I am looking for (4 column) will contain the first set of intervals as columns 1-3 with the single bp foci falling in the fourth column next to their appropriate interval from set 1. For some of the intervals in the first set there are multiple single bp foci in the second set and I would like that represented in the final 4 column interval. Not sure if this is entirely clear, let me know if there is a way to do this. Thanks!

bedtools bedops bed interval • 992 views
ADD COMMENT
1
Entering edit mode

So you want to let the first 3 columns representing the intervals in set 1, then show the foci from set 2 located in the interval in column 4? How do you want to show them, can you give an example output?

ADD REPLY
0
Entering edit mode

Yes thats exactly it, I want the foci as a single bp location added to the fourth column of set 1 specifically next those intervals they fall within.

ADD REPLY
0
Entering edit mode

so what do you mean by this "For some of the intervals in the first set there are multiple single bp foci in the second set and I would like that represented in the final 4 column interval." ?

ADD REPLY

Login before adding your answer.

Traffic: 2637 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