Find the proportion of a query reange which overlaps the subject

propOverlap(x, y, ...)

# S4 method for class 'GRanges,GRanges'
propOverlap(x, y, ignore.strand = FALSE, ...)

Arguments

x, y

A GenomicRanges object

...

Not used

ignore.strand

If set to TRUE, then the strand of x and y is set to "*" prior to any computation.

Value

Numeric vector the same length as x

Details

This behaves similarly to overlapsAny except the proportion of the query range which overlaps one or more subject ranges is returned instead of a logical vector

Examples

x <- GRanges("chr1:1-10")
y <- GRanges("chr1:1-5")
propOverlap(x, y)
#> [1] 0.5
propOverlap(y, x)
#> [1] 1