This function is a utility wrapper for SummarizedExperiment that provides automatic subsetting for row and column data, as well as automatic handling of transgenes and spike-ins.

makeSingleCellExperiment(assays, ...)

# S4 method for SimpleList
makeSingleCellExperiment(assays,
  rowRanges = GRangesList(), colData = DataFrame(),
  metadata = list(), reducedDims = SimpleList(),
  transgeneNames = NULL, spikeNames = NULL)

# S4 method for list
makeSingleCellExperiment(assays,
  rowRanges = GRangesList(), colData = DataFrame(),
  metadata = list(), reducedDims = SimpleList(),
  transgeneNames = NULL, spikeNames = NULL)

Arguments

assays

SimpleList. Count matrices, which must have matching dimensions. Counts can be passed in as either a dense matrix (matrix) or sparse matrix (sparseMatrix).

...

Additional arguments.

rowRanges

GRanges or GRangesList. Genomic ranges (e.g. genome annotations). Metadata describing the assay rows.

colData

DataFrame. Metadata describing the assay columns. For bulk RNA-seq, this data describes the samples. For single-cell RNA-seq, this data describes the cells.

metadata

list. Metadata.

reducedDims

SimpleList. List containing matrices of cell coordinates in reduced space.

transgeneNames

character. Vector indicating which assay rows denote transgenes (e.g. EGFP, TDTOMATO).

spikeNames

character. Vector indicating which assay rows denote spike-in sequences (e.g. ERCCs).

Value

SingleCellExperiment.

Note

Updated 2019-08-05.

Session information

This function improves upon the standard constructor by slotting useful session information into the metadata slot by default:

  • date: Today's date, returned from Sys.Date.

  • wd: Working directory, returned from getwd.

  • sessionInfo: sessioninfo::session_info() return.

This behavior can be disabled by setting sessionInfo = FALSE.

See also

Examples

data(SingleCellExperiment, package = "acidtest") ## SimpleList ==== object <- SingleCellExperiment assays <- assays(object) rowRanges <- rowRanges(object) colData <- colData(object) metadata <- metadata(object) reducedDims <- reducedDims(object) x <- makeSingleCellExperiment( assays = assays, rowRanges = rowRanges, colData = colData, metadata = metadata, reducedDims = reducedDims ) print(x)
#> class: SingleCellExperiment #> dim: 500 100 #> metadata(3): date sessionInfo wd #> assays(1): counts #> rownames(500): gene001 gene002 ... gene499 gene500 #> rowData names(8): broadClass description ... geneName seqCoordSystem #> colnames(100): cell001 cell002 ... cell099 cell100 #> colData names(1): sampleID #> reducedDimNames(0): #> spikeNames(0):