Retrieve overlap widths with Bioconductor
Whilst intersect is sort of doing what you want, it merges adjacent overlaps together which is not what you want I suppose. There doesn't seem to be dedicated Grange function to do this out of the box, but you could go through all overlapping pairs resulting from findOverlap and calculate it's widths using pintersect:

punion, pintersect, psetdiff and pgap are generic functions that compute the element-wise (aka &quot;parallel&quot;) union, intersection, (asymmetric!) difference and gap between each element in x and its corresponding element in y.


&quot;pintersect&quot;(x, y, resolve.empty=c(&quot;none&quot;, &quot;max.start&quot;, &quot;start.x&quot;), ...) # x, y   IRanges objects.

hits &lt;- findOverlaps(gr1, gr2)

width(pintersect(gr1[queryHits(hits)],
                 gr2[subjectHits(hits)]))
[1]  2  6  4  6 10