This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Detecting Overlaps within Grange Object

Hello,

I have a Grange object which contains coordinates. I am using

findOverlaps()

function from the

GenomicRanges Package

inorder to detect overlaps. They provide 2 options, either minOverlap or maxGap. But I was trying to find a way to detect, maxOverlap or minGap. Is there a way to get to these options from the findOverlap function?

r genomicranges granges

1 answer

maxOverlap or minGap

These are exceedingly strange overlap requirements. What are you trying to do? Do you really want to do this?

If you really want these, then you should generate all possible pairings between query and subject, then removing the pairings that satisfy the corresponding minOverlap or maxGap criteria using the standard a findOverlaps() invocation.

For a non-overlapping granges with 1000 elements, a findOverlaps() with a maxOverlap or minGap of 0 of the granges object with itself will return 999,000 "overlaps" (all 1000*1000 combinations minus the 1000 self overlaps that actually overlap). Are you sure this is what you actually want to do?

Log in to answer this question.