Skip to contents

Coerce object to SingleCellExperiment

Usage

as.SingleCellExperiment(x, ...)

# S4 method for Seurat
as.SingleCellExperiment(x)

Arguments

x

Object.

...

Additional arguments.

Value

DESeqDataSet.

Details

S4 coercion support for creating a SingleCellExperiment from a Seurat class object. Internally, this method improves the basic Seurat::as.SingleCellExperiment S3 coercion method, including the object@scale.data matrix, and will keep track of stashed rowRanges and metadata if the Seurat object was originally created from a SingleCellExperiment (i.e. from the bcbioSingleCell package).

Note

Updated 2023-10-04.

Examples

data(Seurat, package = "AcidTest")

## Seurat to SingleCellExperiment ====
from <- Seurat
to <- as.SingleCellExperiment(from)
class(to)
#> [1] "SingleCellExperiment"
#> attr(,"package")
#> [1] "SingleCellExperiment"
print(to)
#> class: SingleCellExperiment 
#> dim: 230 80 
#> metadata(2): scaleData variableFeatures
#> assays(2): counts logcounts
#> rownames(230): MS4A1 CD79B ... SPON2 S100B
#> rowData names(6): broadClass geneBiotype ... ncbiGeneId seqCoordSystem
#> colnames(80): ATGCCAGAACGACT CATGGCCTGTGCAT ... GGAACACTTCAGAC
#>   CTTGATTGATCTTC
#> colData names(8): orig.ident nCount_RNA ... RNA_snn_res.1 ident
#> reducedDimNames(3): PCA TSNE UMAP
#> mainExpName: RNA
#> altExpNames(0):