coverage-methods: Coverage of a RangedSummarizedExperiment object

coverage-methodsR Documentation

Coverage of a RangedSummarizedExperiment object

Description

This man page documents the coverage method for RangedSummarizedExperiment objects.

Usage

## S4 method for signature 'RangedSummarizedExperiment'
coverage(x, shift=0L, width=NULL, weight=1L,
            method=c("auto", "sort", "hash"))

Arguments

x

A RangedSummarizedExperiment object.

shift, width, weight, method

See ?coverage in the GenomicRanges package.

Details

This method operates on the rowRanges component of the RangedSummarizedExperiment object, which can be a GenomicRanges or GRangesList object.

More precisely, on RangedSummarizedExperiment object x, coverage(x, ...) is equivalent to coverage(rowRanges(x), ...).

See ?coverage in the GenomicRanges package for the details of how coverage operates on a GenomicRanges or GRangesList object.

Value

See ?coverage in the GenomicRanges package.

See Also

  • RangedSummarizedExperiment objects.

  • The coverage man page in the GenomicRanges package where the coverage methods for GenomicRanges and GRangesList objects are documented.

Examples

nrows <- 20; ncols <- 6
counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)
rowRanges <- GRanges(rep(c("chr1", "chr2"), c(5, 15)),
                     IRanges(sample(1000L, 20), width=100),
                     strand=Rle(c("+", "-"), c(12, 8)),
                     seqlengths=c(chr1=1800, chr2=1300))
colData <- DataFrame(Treatment=rep(c("ChIP", "Input"), 3),
                     row.names=LETTERS[1:6])
rse <- SummarizedExperiment(assays=SimpleList(counts=counts),
                            rowRanges=rowRanges, colData=colData)

cvg <- coverage(rse)
cvg
stopifnot(identical(cvg, coverage(rowRanges(rse))))

Bioconductor/SummarizedExperiment documentation built on Nov. 4, 2022, 11:59 a.m.