Description Usage Arguments Value See Also Examples
Computes t-SNE into two dimensions and plots the map points.
In case there are missing values, PCA is performed using the nipals method of pcaMethods::pca
,
the method can be changed to "ppca" if nipals fails.
CITATION: When using this function, cite the pcaMethods
and Rtsne
packages
1 2 3 4 5 | plot_tsne(object, all_features = FALSE, center = TRUE, scale = "uv",
perplexity = 30, pca_method = "nipals", color = group_col(object),
shape = NULL, label = NULL, density = FALSE, title = "t-SNE",
subtitle = paste("Perplexity:", perplexity), color_scale = NULL,
shape_scale = NULL, fill_scale = NULL, ...)
|
object |
a MetaboSet object |
all_features |
logical, should all features be used? If FALSE (the default), flagged features are removed before visualization. |
center |
logical, should the data be centered prior to PCA? (usually yes) |
scale |
scaling used, as in pcaMethods::prep. Default is "uv" for unit variance |
perplexity |
the perplexity used in t-SNE |
pca_method |
the method used in PCA if there are missing values |
color |
character, name of the column used for coloring the points |
shape |
character, name of the column used for shape |
label |
character, name of the column used for point labels |
density |
logical, whether to include density plots to both axes |
title, subtitle |
the titles of the plot |
color_scale |
the color scale as returned by a ggplot function |
shape_scale |
the shape scale as returned by a ggplot function |
fill_scale |
the fill scale used for density curves |
... |
additional arguments passed to |
a ggplot object. If density
is TRUE
, the plot will consist of multiple
parts and is harder to modify.
1 | plot_tsne(merged_sample, color = "Time", shape = "Group")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.