run.tsne: Run the tSNE algorithm (using Rtsne::Rtsne())

Description Usage Arguments Author(s) Examples

View source: R/run.tsne.R

Description

Method to run a tSNE dimensionality reduction algorithm. A tSNE (t-distributed stochastic neighbor embedding) plot is a useful means to visualise data. As it is a dimensionality reduction algorithm, some data will be lost. It is good practice to validate any populations (namely through manual gating). Output data will be "tsne.res". Uses the R package "Rtsne" to calculate plots.

Usage

1
run.tsne(dat, use.cols, tsne.x.name, tsne.y.name, tsne.seed, dims, initial_dims, perplexity, theta, check_duplicates, pca, max_iter, verbose, is_distance, Y_init, stop_lying_iter, mom_switch_iter, momentum, final_momentum, eta, exaggeration_factor)

Arguments

dat

NO DEFAULT. data.frame.

use.cols

NO DEFAULT. Vector of numbers, reflecting the columns to use for dimensionality reduction.

tsne.x.name

DEFAULT = "tSNE_X". Character. Name of tSNE x-axis.

tsne.y.name

DEFAULT = "tSNE_Y". Character. Name of tSNE y-axis.

tsne.seed

DEFAULT = 42. Numeric. Seed value for reproducibility.

dims

DEFAULT = 2. Number of dimensions for output results, either 2 or 3.

initial_dims

DEFAULT = 50. Number of dimensions retained in initial PCA step.

perplexity

DEFAULT = 30.

theta

DEFAULT = 0.5. Use 0.5 for Barnes-Hut tSNE, 0.0 for exact tSNE (takes longer).

check_duplicates

DEFAULT = FALSE.

pca

DEFAULT = TRUE. Runs PCA prior to tSNE run.

max_iter

DEFAULT = 1000. Maximum number of iterations.

verbose

DEFAULT = TRUE.

is_distance

DEFAULT = FALSE. Experimental, using X as a distance matrix.

Y_init

DEFAULT = NULL. Recommend NULL for random initialisation.

stop_lying_iter

DEFAULT = 250. Number of iterations of early exaggeration.

mom_switch_iter

DEFAULT = 250. Number of iterations before increased momentum of spread.

momentum

DEFAULT = 0.5. Initial momentum of spread.

final_momentum

DEFAULT = 0.8. Momentum of spread at 'final_momentum'.

eta

DEFAULT = 200. Learning rate.

exaggeration_factor

DEFAULT = 12.0. Factor used during early exaggeration.

Author(s)

Felix Marsh-Wakefield, felix.marsh-wakefield@sydney.edu.au

Examples

1
2
3
4
5
# Run tSNE on a subset of the  demonstration dataset

cell.dat <- do.subsample(Spectre::demo.asinh, 10000) # Subsample the demo dataset to 10000 cells
cell.dat <- Spectre::run.tsne(dat = cell.dat,
                              use.cols = names(demo.asinh)[c(2:10)])

sydneycytometry/Spectre documentation built on March 20, 2021, 2:15 a.m.