R/reduceRanges.R

Defines functions reduceRanges

Documented in reduceRanges

### =========================================================================
### reduceRanges
### =========================================================================

reduceRanges <- function(ranges, files, MAP, REDUCE, ..., init) {
    if (is(ranges, "GenomicFiles")) {
        files <- GenomicFiles::files(ranges)
        ranges <- rowRanges(ranges)
    }
    if (!is(ranges, "GRanges") && !is(ranges, "GRangesList"))
        stop("'ranges' must be GRanges or GRangesList")

    .reduceByRange(ranges, files, MAP, REDUCE, ..., iterate=FALSE)
}
Bioconductor/GenomicFiles documentation built on Oct. 31, 2024, 7:01 a.m.