getTSNE: Run t-SNE dimensionality reduction method on the assay data.

View source: R/getTSNE.R

getTSNER Documentation

Run t-SNE dimensionality reduction method on the assay data.

Description

Run t-SNE dimensionality reduction method on the assay data.

Usage

getTSNE(
  inSCE,
  useAssay = "logcounts",
  reducedDimName = "TSNE",
  n_iterations = 1000,
  perplexity = NULL,
  run_pca = TRUE
)

Arguments

inSCE

Input SCtkExperiment object. Required

useAssay

Indicate which assay to use. The default is "logcounts".

reducedDimName

a name to store the results of the dimension reductions

n_iterations

maximum iterations. Default is 1000

perplexity

perplexity parameter.

run_pca

run tSNE on PCA components? Default is TRUE.

Value

A SCtkE object with the specified reducedDim and pcaVariances updated

Examples

data("mouseBrainSubsetSCE")
#add a CPM assay
assay(mouseBrainSubsetSCE, "cpm") <- apply(
  assay(mouseBrainSubsetSCE, "counts"), 2, function(x) {
    x / (sum(x) / 1000000)
  })
mouseBrainSubsetSCE <- getTSNE(mouseBrainSubsetSCE, useAssay = "cpm",
                               reducedDimName = "TSNE_cpm")
reducedDims(mouseBrainSubsetSCE)


mmkhan19/singleCellTK documentation built on March 22, 2022, 7:43 a.m.