Support for finding regions overlapped by two different IntervalTrees#31
Support for finding regions overlapped by two different IntervalTrees#31ssadedin wants to merge 1 commit intochaimleib:masterfrom
Conversation
There was a problem hiding this comment.
Is there a reason that the overlaps have to be merged? This causes a new tree to be created a second time, which is O(nlogn).
There was a problem hiding this comment.
Mainly, I was after API compatibility with the R functions that do the same thing (in this case, IRanges intersect() function - unfortunately 'intersect' is already used with different semantics in this library). My own use case for this kind of function always involves merging because I want to do computations on the parts in common between two sets of ranges, and I rarely want to do that computation on the same interval twice, so merging makes sense. I can imagine there could be uses where that's not the case. I tend to port a lot of code b/w R and python so having something that behaves the same way between the two was useful to me.
This change adds a function for finding the common regions between two interval trees. That is, the intervals in the result are the ranges where at least one interval in both trees overlap each other.