R/overlapResults.R

Defines functions overlapResults

Documented in overlapResults

#' @export
#' @importFrom S4Vectors DataFrame metadata<-
#' @importFrom IRanges findOverlaps
overlapResults <- function(ranges, tab, regions, get.best=TRUE, overlap.args=list(), combine.args=list(), best.args=list()) {
    olap <- do.call(findOverlaps, c(list(query=regions, subject=ranges), overlap.args))
    combined <- do.call(combineOverlaps, c(list(olap, tab), combine.args))
    output <- DataFrame(regions=I(regions), combined=I(combined))
    if (get.best) {
        output$best <- do.call(getBestOverlaps, c(list(olap, tab), best.args))
    }
    metadata(output)$overlaps <- olap
    output
}

Try the csaw package in your browser

Any scripts or data that you put into this service are public.

csaw documentation built on Nov. 12, 2020, 2:03 a.m.