R/reduceFiles.R

Defines functions reduceFiles

Documented in reduceFiles

### =========================================================================
### reduceFiles
### =========================================================================

reduceFiles <- 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")

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