Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

runTSNE

Perform t-SNE dimensionality reduction


Description

Runs t-SNE on the normalized cell factors (or raw cell factors) to generate a 2D embedding for visualization. Has option to run on subset of factors. Note that running multiple times will reset tsne.coords values.

Usage

runTSNE(
  object,
  use.raw = FALSE,
  dims.use = 1:ncol(object@H.norm),
  use.pca = FALSE,
  perplexity = 30,
  theta = 0.5,
  method = "Rtsne",
  fitsne.path = NULL,
  rand.seed = 42
)

Arguments

object

liger object. Should run quantile_norm before calling with defaults.

use.raw

Whether to use un-aligned cell factor loadings (H matrices) (default FALSE).

dims.use

Factors to use for computing tSNE embedding (default 1:ncol(H.norm)).

use.pca

Whether to perform initial PCA step for Rtsne (default FALSE).

perplexity

Parameter to pass to Rtsne (expected number of neighbors) (default 30).

theta

Speed/accuracy trade-off (increase for less accuracy), set to 0.0 for exact TSNE (default 0.5).

method

Supports two methods for estimating tSNE values: Rtsne (Barnes-Hut implementation of t-SNE) and fftRtsne (FFT-accelerated Interpolation-based t-SNE) (using Kluger Lab implementation). (default Rtsne)

fitsne.path

Path to the cloned FIt-SNE directory (ie. '/path/to/dir/FIt-SNE') (required for using fftRtsne – only first time runTSNE is called) (default NULL).

rand.seed

Random seed for reproducibility (default 42).

Details

In order to run fftRtsne (recommended for large datasets), you must first install FIt-SNE as detailed here. Include the path to the cloned FIt-SNE directory as the fitsne.path parameter, though this is only necessary for the first call to runTSNE. For more detailed FIt-SNE installation instructions, see the liger repo README.

Value

liger object with tsne.coords slot set.

Examples

## Not run: 
# ligerex (liger object), factorization complete
# generate H.norm by quantile normalizig factor loadings
ligerex <- quantile_norm(ligerex)
# get tsne.coords for normalized data
ligerex <- runTSNE(ligerex)
# get tsne.coords for raw factor loadings
ligerex <- runTSNE(ligerex, use.raw = TRUE)

## End(Not run)

rliger

Linked Inference of Genomic Experimental Relationships

v1.0.0
GPL-3
Authors
Joshua Welch [aut, ctb], Chao Gao [aut, ctb, cre], Jialin Liu [aut, ctb], Joshua Sodicoff [aut, ctb], Velina Kozareva [aut, ctb], Evan Macosko [aut, ctb], Paul Hoffman [ctb], Ilya Korsunsky [ctb], Robert Lee [ctb]
Initial release
2021-04-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.