R/scater_PCA.R
scaterPCA.Rd
Perform PCA on a SingleCellExperiment Object A wrapper to runPCA function to compute principal component analysis (PCA) from a given SingleCellExperiment object.
scaterPCA(
inSCE,
useAssay = "logcounts",
useAltExp = NULL,
reducedDimName = "PCA",
nComponents = 50,
scale = FALSE,
ntop = NULL,
seed = NULL
)
Input SingleCellExperiment object.
Assay to use for PCA computation. If useAltExp
is
specified, useAssay
has to exist in
assays(altExp(inSCE, useAltExp))
. Default "logcounts"
The subset to use for PCA computation, usually for the
selected.variable features. Default NULL
.
Name to use for the reduced output assay. Default
"PCA"
.
Number of principal components to obtain from the PCA
computation. Default 50
.
Logical scalar, whether to standardize the expression values.
Default FALSE
.
Number of top features to use as a further variable feature
selection. Default NULL
.
Random seed for reproducibility of PCA results.
A SingleCellExperiment object with PCA computation
updated in reducedDim(inSCE, reducedDimName)
.
data(scExample, package = "singleCellTK")
sce <- subsetSCECols(sce, colData = "type != 'EmptyDroplet'")
sce <- scaterlogNormCounts(sce, "logcounts")
sce <- scaterPCA(sce, "logcounts")