calcTsne: Calculate tSNE projection of data

Description Usage Arguments Value Examples

View source: R/tsne.R

Description

Calculates a spectral tSNE representation of the data, based either on PCA or diffusion map reductions.

Usage

1
2
3
4
5
6
7
8
9
calcTsne(
  object,
  dim.use = c("pca", "dm"),
  which.dims = which(object@pca.sig),
  perplexity = 30,
  theta = 0.5,
  max_iter = 1000,
  verbose = FALSE
)

Arguments

object

An URD object

dim.use

(Character) Whether to calculate the tSNE projection from PCs ("pca") or diffusion components ("dm"). Default is from PCs.

which.dims

(Numeric vector) Which PCs (or diffusion components) to use. Defaults to the significant PCs. (We don't estimate the significant diffusion components, so if using diffusion map reduction, probably should explicitly specify this.)

theta

(Numeric) Speed/accuracy trade-off for Barnes-Hut approximation of tSNE (0-1, 0 is exact tSNE, higher is less accurate, default is 0.5)

max_iter

(Numeric) Number of iterations to perform

verbose

(Logical) Should Rtsne print progress updates?

perlexity

(Numeric) Perplexity parameter for the tSNE

Value

An URD object with tSNE coordinates stored in the @tsne.y slot.

Examples

1
2
3
4
5
6
7
8
# Set seed to get reproducible reduction, since tSNE is stochastic.
set.seed(18)

# Calculate tSNE on PCA (the default)
object <- calcTsne(object, perplexity = 30, theta = 0.5)

# Calculate tSNE on 18 DCs from diffusion map.
object <- calcTsne(object, dim.use="dm", which.dims=1:18, perplexity=30)

farrellja/URD documentation built on June 17, 2020, 4:48 a.m.