as.SummarizedExperiment: Coerce to 'SummarizedExperiment'.

as.SummarizedExperimentR Documentation

Coerce to SummarizedExperiment.

Description

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

Usage

as.SummarizedExperiment(x, ...)

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

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

Arguments

x

Object.

...

Additional arguments.

Value

SummarizedExperiment.

Note

Updated 2022-05-04.

Examples

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

acidgenomics/r-acidexperiment documentation built on Jan. 17, 2024, 7:56 p.m.