I have a sorted large BED file (main.bed) and several regions defined in a file (regions.bed) which can be overlapping with each other. I am trying to find a quick way to output the overlaps from the main BED file with the regions defined in regions.bed, and create a separate BED output file for each of these regions.
bedops --everything
seems as a good option, but is there a way to output different intersects between main.bed and regions.bed in a different file for each line of regions.bed?
Thank you! Fra
Thank you dariober, this is what I had tried before using loops but I was hoping there was a faster solution since my regions/files are around 1,000 (they are temp files, meaning I use them and remove them right after, it is just to load them into R)...
Hi - See if my edit helps.