Dear experts,
I have a sorted large BED file (main.bed) and several regions defined in a file (regions.bed) which can be overlapping. I am trying to find a quick way to overlap the main BED file with the regions defined in regions.bed, and create a separate BED output file for each of these regions.
I can do it using a loop with bash by looping through each line of main.bed and finding the regions that overlap regions.bed though an awk command, but it is extremely slow. I can also do it with intersectBed from bedtools but I am still using a loop to specify each region... Is there a better way to do this?
Thank you!
Francesca
I have a sorted large BED file (main.bed) and several regions defined in a file (regions.bed) which can be overlapping. I am trying to find a quick way to overlap the main BED file with the regions defined in regions.bed, and create a separate BED output file for each of these regions.
I can do it using a loop with bash by looping through each line of main.bed and finding the regions that overlap regions.bed though an awk command, but it is extremely slow. I can also do it with intersectBed from bedtools but I am still using a loop to specify each region... Is there a better way to do this?
Thank you!
Francesca
Comment