tsne_phyloseq: Create a ggplot object using t-SNE from a phyloseq object....

tsne_phyloseqR Documentation

Create a ggplot object using t-SNE from a phyloseq object. Function from the phylosmith-package.

Description

Inputs a phyloseq-class object to plot the t-SNE of a treatment or set of treatments.

Usage

tsne_phyloseq(phyloseq_obj, treatment, method = 'bray', perplexity = 10,
circle = TRUE, labels = NULL, colors = 'default')

Arguments

phyloseq_obj

A phyloseq-class object. It must contain sample_data()) with information about each sample, and it must contain tax_table()) with information about each taxa/gene.

treatment

Column name as a string or number in the sample_data. This can be a vector of multiple columns and they will be combined into a new column.

method

the distance measurement algorithm to use, match to "euclidean", "manhattan", "canberra", "clark", "bray", "kulczynski", "jaccard", "gower", "altGower", "morisita", "horn", "mountford", "raup", "binomial", "chao", "cao" or "mahalanobis".

perplexity

similar to selecting the number of neighbors to consider in decision making (should not be bigger than 3 * perplexity < nrow(X) - 1, see Rtsne for interpretation)

circle

If TRUE, a stat_ellipse around each of the treatment factors (TRUE). If numeric between 0 and 1, will add ellipse of confidence interval equal to value given (i.e. 0.95 produces ellipses of 95% confidence intervals)

labels

Column name as a string or number in the sample_data to use to place labels of that factor instead of circle points.

colors

Name of a color set from the RColorBrewer package or a vector palette of R-accepted colors.

Value

ggplot-object

See Also

Rtsne

Examples

tsne_phyloseq(soil_column,
treatment = c('Matrix', 'Treatment'), perplexity = 8)

schuyler-smith/phylosmith documentation built on Aug. 17, 2024, 10:19 a.m.