A wrapper to runPCA function to compute principal component analysis (PCA) from a given SingleCellExperiment object.
scaterPCA(
inSCE,
useAssay = "logcounts",
useFeatureSubset = NULL,
scale = TRUE,
reducedDimName = "PCA",
nComponents = 50,
ntop = 2000,
useAltExp = NULL,
seed = NULL,
BPPARAM = BiocParallel::SerialParam()
)Input SingleCellExperiment object.
Assay to use for PCA computation. If useAltExp is
specified, useAssay has to exist in
assays(altExp(inSCE, useAltExp)). Default "logcounts"
Subset of feature to use for dimension reduction. A
character string indicating a rowData variable that stores the logical
vector of HVG selection, or a vector that can subset the rows of
inSCE. Default NULL.
Logical scalar, whether to standardize the expression values.
Default TRUE.
Name to use for the reduced output assay. Default
"PCA".
Number of principal components to obtain from the PCA
computation. Default 50.
Automatically detect this number of variable features to use for
dimension reduction. Ignored when using useReducedDim or using
useFeatureSubset. Default 2000.
The subset to use for PCA computation, usually for the
selected.variable features. Default NULL.
Integer, random seed for reproducibility of PCA results.
Default NULL.
A BiocParallelParam object specifying whether the PCA should be parallelized.
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", scale = TRUE)
#> Sat Mar 18 10:31:42 2023 ... Computing Scater PCA.