R/ranges-overlap-count.R
ranges-count-overlaps.RdCount the number of overlaps between two Ranges objects
count_overlaps(x, y, maxgap, minoverlap)
# S3 method for class 'IntegerRanges'
count_overlaps(x, y, maxgap = -1L, minoverlap = 0L)
# S3 method for class 'GenomicRanges'
count_overlaps(x, y, maxgap = -1L, minoverlap = 0L)
count_overlaps_within(x, y, maxgap, minoverlap)
# S3 method for class 'IntegerRanges'
count_overlaps_within(x, y, maxgap = 0L, minoverlap = 1L)
# S3 method for class 'GenomicRanges'
count_overlaps_within(x, y, maxgap = 0L, minoverlap = 1L)
count_overlaps_directed(x, y, maxgap, minoverlap)
# S3 method for class 'GenomicRanges'
count_overlaps_directed(x, y, maxgap = -1L, minoverlap = 0L)
count_overlaps_within_directed(x, y, maxgap, minoverlap)
# S3 method for class 'GenomicRanges'
count_overlaps_within_directed(x, y, maxgap = -1L, minoverlap = 0L)An integer vector of same length as x.
query <- data.frame(start = c(5,10, 15,20), width = 5, gc = runif(4)) %>%
as_iranges()
subject <- data.frame(start = 2:6, width = 3:7, label = letters[1:5]) %>%
as_iranges()
query %>% mutate(n_olap = count_overlaps(., subject),
n_olap_within = count_overlaps_within(., subject))
#> Error: unable to find an inherited method for function ‘countOverlaps’ for signature ‘query = "IRanges", subject = "standardGeneric"’