runTSNE | R Documentation |
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.
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
)
object |
|
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). |
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.
liger
object with tsne.coords slot set.
ligerex <- createLiger(list(ctrl = ctrl, stim = stim))
ligerex <- normalize(ligerex)
ligerex <- selectGenes(ligerex)
ligerex <- scaleNotCenter(ligerex)
# Specification for minimal example run time, not converging
ligerex <- optimizeALS(ligerex, k = 5, max.iters = 1)
ligerex <- quantile_norm(ligerex)
ligerex <- runTSNE(ligerex)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.