| Reduced dimensions {SingleCellExperiment} | R Documentation |
Methods to get or set the dimensionality reduction results.
## S4 method for signature 'SingleCellExperiment' reducedDim(x, type=1, withDimnames=TRUE) ## S4 replacement method for signature 'SingleCellExperiment' reducedDim(x, type=1) <- value ## S4 method for signature 'SingleCellExperiment' reducedDims(x, withDimnames=TRUE) ## S4 replacement method for signature 'SingleCellExperiment' reducedDims(x) <- value ## S4 method for signature 'SingleCellExperiment' reducedDimNames(x) ## S4 replacement method for signature 'SingleCellExperiment,character' reducedDimNames(x) <- value
x |
A SingleCellExperiment object. |
type |
A string containing the name for the dimensionality reduction results or a numeric index containing the position of the desired dimenionality reduction result. |
withDimnames |
A logical scalar indicating whether each set of results should be returned with row names matching |
value |
For For For |
Dimensionality reduction is often used to interpreting the results of single-cell data analysis.
These methods allow the results of dimensionality reduction methods to be stored in a SingleCellExperiment object.
Multiple results can be stored in a single object by assigning to different type in reducedDim<-.
If value is NULL for reducedDim<-, the set of results corresponding to type is removed from the object.
If value is NULL for reducedDims<-, all dimensionality reduction results are removed.
Note that the reducedDims slot must always be named for consistency.
Unnamed results assigned via reducedDim<- or reducedDims<- will be assigned empty names.
For reducedDim, a numeric matrix is returned containing coordinates for cells (rows) and dimensions (columns).
For reducedDims, a named SimpleList of matrices is returned, with one matrix for each type of dimensionality reduction method.
For reducedDimNames, a character vector containing the names of the elements in reducedDims.
For reducedDim<- and reducedDims<-, a SingleCellExperiment object is returned with updated results in the reducedDims slot.
Aaron Lun
example(SingleCellExperiment, echo=FALSE) reducedDim(sce, "PCA") reducedDim(sce, "tSNE") reducedDims(sce) reducedDim(sce, "PCA") <- NULL reducedDims(sce) reducedDims(sce) <- SimpleList() reducedDims(sce)