Hi everyone,

I have used the "findOverlaps" function in R to find which positions of my two datasets overlap. I have also used "countOverlaps" to see how many overlaps I have.

What I want to do now, is to find the exact coordinates which overlapped. I was looking how to do it using findOverlaps but it has no such options and by doing a google search, I couldn't find much help.

A little help on this would be greatly appreciated.

Thank you

I have switched to

`foverlaps`

(`data.table`

package) whenever I working with genomic regions.A fast binary-search based overlap join of two data.tables. This is very much inspired by findOverlaps function from the bioconductor package IRanges...Simply intersect two data tables and extract overlapping region. Please post example data and I will show how it may be done.

Thank you for your reply Pgibas. Example data as required:

1st dataset:

2nd dataset:

Thanks again!

You datasets don't overlap.

What is the expected output? Do you want a new set of regions that represents the overlaps between dataset 1 and 2?

yes! exactly that!

I personally use mergeByOverlaps and subsetByOverlaps for these cases.