SingleCellExperiment: SingleCellExperiment class

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

View source: R/SCE-create.R

Description

A description of the SingleCellExperiment class for storing single-cell sequencing data.

Usage

1

Arguments

...

Arguments to pass to the SummarizedExperiment constructor.

reducedDims

A SimpleList object containing matrices of cell coordinates in reduced space.

Details

The SingleCellExperiment class inherits from the SummarizedExperiment class, with several additional slots:

reducedDims:

A SimpleList containing matrices of cell coordinates.

int_elementMetadata:

A DataFrame containing internal row metadata (for each genomic feature).

int_colData:

A DataFrame containing internal column metadata (for each cell).

int_metadata:

A list containing internal experiment metadata.

The intended use of this class is the same as that for SummarizedExperiment instances. Rows should represent genomic features such as genes, while columns represent samples - in this case, single cells. Different quantifications (e.g., counts, CPMs, log-expression) can be stored simultaneously in the assays slot. Row and column metadata can be attached using rowData and colData, respectively.

The additional reducedDims slot allows storage of results from multiple dimensionality reduction methods, e.g., PCA or t-SNE. Each element of the SimpleList should be a matrix of coordinates for all cells from one reduction method. The number of rows of each matrix should be equal to the number of cells in the SingleCellExperiment object.

The internal metadata slots are not intended for external use. Please use the appropriate getter/setter functions instead, such as isSpike or sizeFactors. Package developers should refer to the suggestions in ?int_metadata.

Value

A SingleCellExperiment object is returned from the constructor.

Author(s)

Aaron Lun and Davide Risso

See Also

isSpike, sizeFactors, reducedDims

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
ncells <- 100
u <- matrix(rpois(20000, 5), ncol=ncells)
v <- log2(u + 1)

pca <- matrix(runif(ncells*5), ncells)
tsne <- matrix(rnorm(ncells*2), ncells)

sce <- SingleCellExperiment(assays=list(counts=u, logcounts=v),
    reducedDims=SimpleList(PCA=pca, tSNE=tsne))
sce

## coercion from SummarizedExperiment
se <- SummarizedExperiment(assays=list(counts=u, logcounts=v))
as(se, "SingleCellExperiment")

SingleCellExperiment documentation built on May 6, 2019, 4:05 a.m.