getTSNE: Run t-SNE dimensionality reduction method on a...

Description Usage Arguments Value Examples

View source: R/getTSNE.R

Description

Run t-SNE dimensionality reduction method on a SingleCellExperiment Object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
getTSNE(
  inSCE,
  useAssay = "logcounts",
  useAltExp = NULL,
  reducedDimName = "TSNE",
  n_iterations = 1000,
  perplexity = NULL,
  run_pca = TRUE,
  ntop = NULL
)

Arguments

inSCE

Input SingleCellExperiment object.

useAssay

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

useAltExp

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

reducedDimName

a name to store the results of the dimension reductions. Default "TSNE".

n_iterations

maximum iterations. Default 1000.

perplexity

perplexity parameter. Default NULL.

run_pca

run tSNE on PCA components? Default TRUE.

ntop

Number of top features to use as a further variable feature selection. Default NULL.

Value

A SingleCellExperiment object with tSNE computation updated in reducedDim(inSCE, reducedDimName).

Examples

1
2
3
4
5
6
7
8
9
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)

singleCellTK documentation built on Nov. 8, 2020, 5:21 p.m.