R/runDimReduce.R
runDimReduce.Rd
Generic Wrapper function for running dimensionality reduction
runDimReduce(
inSCE,
method = c("scaterPCA", "seuratPCA", "seuratICA", "rTSNE", "seuratTSNE",
"scaterUMAP", "seuratUMAP"),
useAssay = NULL,
useReducedDim = NULL,
useAltExp = NULL,
reducedDimName,
nComponents = 20,
seed = NULL,
...
)
Input SingleCellExperiment object.
One from "scaterPCA"
, "seuratPCA"
,
"seuratICA"
, "rTSNE"
, "seuratTSNE"
, "scaterUMAP"
and "seuratUMAP"
.
Assay to use for computation. If useAltExp
is
specified, useAssay
has to exist in
assays(altExp(inSCE, useAltExp))
. Default "counts"
.
The low dimension representation to use for embedding
computation. Default NULL
.
The subset to use for computation, usually for the
selected variable features. Default NULL
.
The name of the result matrix. Required.
Specify the number of dimensions to compute with the selected method in case of PCA/ICA and the number of components to use in the case of TSNE/UMAP methods.
Random seed for reproducibility of results.
Default NULL
will use global seed in use by the R environment.
The other arguments for running a specific algorithm. Please refer to the one you use.
The input SingleCellExperiment object with
reducedDim
updated with the result.
Wrapper function to run one of the available dimensionality
reduction algorithms integrated within SCTK from scaterPCA
,
runSeuratPCA
, runSeuratICA
, getTSNE
,
runSeuratTSNE
, getUMAP
and
runSeuratUMAP
. Users can use an assay by specifying
useAssay
, use the assay in an altExp by specifying both
useAltExp
and useAssay
, or use a low-dimensionality
representation by specifying useReducedDim
.
data(scExample, package = "singleCellTK")
sce <- subsetSCECols(sce, colData = "type != 'EmptyDroplet'")
sce <- runNormalization(sce, useAssay = "counts",
outAssayName = "logcounts_scaled",
normalizationMethod = "logNormCounts",
scale = TRUE)
#> Normalization performed using logNormCounts method.
#> Z.Score scaling performed on the input data.
sce <- runDimReduce(inSCE = sce, method = "scaterPCA",
useAssay = "logcounts_scaled",
reducedDimName = "PCA")
#> Thu Apr 28 11:27:55 2022 ... Computing Scater PCA.