Selects the 500 most variable genes in the SCE, performs PCA based on them and stores the values in the reducedDims slot of the SCE object.
getPCA(inSCE, useAssay = "logcounts", reducedDimName = "PCA")
Input SCtkExperiment object. Required
Indicate which assay to use for PCA. Default is "counts"
Store the PCA data with this name. The default is PCA. The toolkit will store data with the pattern <ASSAY>_<ALGORITHM>.
A SCtkE object with the specified reducedDim and pcaVariances updated
data("mouseBrainSubsetSCE")
#add a CPM assay
assay(mouseBrainSubsetSCE, "cpm") <- apply(assay(mouseBrainSubsetSCE,
"counts"),
2, function(x) {
x / (sum(x) / 1000000)
})
mouseBrainSubsetSCE <- getPCA(mouseBrainSubsetSCE,
useAssay = "cpm",
reducedDimName = "PCA_cpm")
reducedDims(mouseBrainSubsetSCE)
#> List of length 5
#> names(5): PCA_counts PCA_logcounts TSNE_counts TSNE_logcounts PCA_cpm