coerce-SummarizedExperiment: Coerce to summarized experiment

Description Usage Arguments Details Value Note Examples

Description

Coerce to SummarizedExperiment.

Usage

1
2
3
4
5
6
7
as.SummarizedExperiment(x, ...)

## S4 method for signature 'SummarizedExperiment'
as.SummarizedExperiment(x)

## S4 method for signature 'RangedSummarizedExperiment'
as.SummarizedExperiment(x)

Arguments

x

Object.

...

Additional arguments.

Details

Improved S4 methods for reliably coercing objects that extend RangedSummarizedExperiment to a standard SummarizedExperiment, that doesn't drop rowData().

Related S4 coercion method of interest:

1
2
3
4
5
6
7
8
getMethod(
    f = "coerce",
    signature = signature(
        from = "RangedSummarizedExperiment",
        to = "SummarizedExperiment"
    ),
    where = asNamespace("SummarizedExperiment")
)

Value

SummarizedExperiment.

Note

Updated 2020-01-08.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
suppressPackageStartupMessages(library(SummarizedExperiment))
data(RangedSummarizedExperiment, package = "acidtest")

## RangedSummarizedExperiment ===
## Current S4 coercion drops row metadata.
names(metadata(rowRanges(RangedSummarizedExperiment)))
se <- as(RangedSummarizedExperiment, "SummarizedExperiment")
names(metadata(rowData(se)))
## Our alternate S3 method preserves the metadata.
se <- as.SummarizedExperiment(RangedSummarizedExperiment)
names(metadata(rowData(se)))

steinbaugh/S4Transformer documentation built on Jan. 9, 2020, 7:30 p.m.