SEmethods: SummarizedExperiment to DGEList

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Converting a SummarizedExperiment object to a DGEList object for analysis with edgeR.

Usage

1
2
## S4 method for signature 'SummarizedExperiment'
asDGEList(object, lib.sizes, norm.factors, assay.id="counts", ...)

Arguments

object

A SummarizedExperiment object or its derived classes, like that produced by windowCounts.

lib.sizes

An (optional) integer vector of library sizes.

norm.factors

An (optional) numeric vector of normalization factors.

assay.id

A string or integer scalar indicating which assay in object contains the count matrix.

...

Other arguments to be passed to DGEList.

Details

Counts are extracted from specified assay matrix in the SummarizedExperiment object and used to construct a DGEList object via DGEList. If not specified in lib.sizes, library sizes are taken from the totals field in the column data of object. Warnings will be generated if this field is not present.

If norm.factors is not specified, asDGEList will attempt to extract normalization factors from object$norm.factors. If this is not available, factors will be set to the default (all unity). If assays(object)$offset is present, this will be assigned to the offset field of the output DGEList object.

Value

A DGEList object is returned containing counts and normalization information.

Author(s)

Aaron Lun

See Also

DGEList

Examples

1
2
3
4
5
6
bamFiles <- system.file("exdata", c("rep1.bam", "rep2.bam"), package="csaw")
data <- windowCounts(bamFiles, width=100, filter=1)

asDGEList(data)
asDGEList(data, lib.sizes=c(10, 100))
asDGEList(data, norm.factors=c(1.11, 2.23), group=c("a", "b"))

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