runDimReduce: Generic Wrapper function for running dimensionality reduction

View source: R/runDimReduce.R

runDimReduceR Documentation

Generic Wrapper function for running dimensionality reduction

Description

Generic Wrapper function for running dimensionality reduction

Usage

runDimReduce(
  inSCE,
  method = c("scaterPCA", "seuratPCA", "seuratICA", "scanpyPCA", "rTSNE", "seuratTSNE",
    "scaterUMAP", "seuratUMAP", "scanpyUMAP", "scanpyTSNE"),
  useAssay = NULL,
  useReducedDim = NULL,
  useAltExp = NULL,
  reducedDimName = method,
  nComponents = 20,
  useFeatureSubset = NULL,
  scale = FALSE,
  seed = 12345,
  ...
)

Arguments

inSCE

Input SingleCellExperiment object.

method

One from "scaterPCA", "seuratPCA", "seuratICA", "rTSNE", "seuratTSNE", "scaterUMAP", "seuratUMAP", "scanpyPCA", "scanpyUMAP" and "scanpyTSNE".

useAssay

Assay to use for computation. If useAltExp is specified, useAssay has to exist in assays(altExp(inSCE, useAltExp)). Default "counts".

useReducedDim

The low dimension representation to use for embedding computation. Default NULL.

useAltExp

The subset to use for computation, usually for the selected variable features. Default NULL.

reducedDimName

The name of the result matrix. Required.

nComponents

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.

useFeatureSubset

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.

scale

Logical scalar, whether to standardize the expression values. Default TRUE.

seed

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.

Details

Wrapper function to run one of the available dimensionality reduction algorithms integrated within SCTK from scaterPCA, runSeuratPCA, runSeuratICA, runTSNE, runSeuratTSNE, runUMAP 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.

Value

The input SingleCellExperiment object with reducedDim updated with the result.

Examples

data(scExample, package = "singleCellTK")
sce <- subsetSCECols(sce, colData = "type != 'EmptyDroplet'")
sce <- runNormalization(sce, useAssay = "counts",
                        outAssayName = "logcounts",
                        normalizationMethod = "logNormCounts")
sce <- runDimReduce(inSCE = sce, method = "scaterPCA",
                    useAssay = "logcounts", scale = TRUE,
                    reducedDimName = "PCA")

compbiomed/singleCellTK documentation built on Oct. 27, 2024, 3:26 a.m.