plot_tsne_phyloseq: Plot microbiota t-SNE results using ggplot2

Description Usage Arguments Details See Also Examples

Description

This function provides an interface for combining a t-SNE ordination with sample meta data from a phyloseq object.

Usage

1
2
plot_tsne_phyloseq(physeq, tsne_obj, axes = 1:2, color = NULL,
  shape = NULL, title = NULL, justDF = FALSE)

Arguments

physeq

Phylogenetic sequencing data (phyloseq-class).

tsne_obj

An list of class tsne_phyloseq.

axes

The axes to plot. Must be a length 2 numeric.

color

Character string indicating which variable in sample_data should be used as the ggplot2 color aesthetic

shape

Character string indicating which variable in sample_data should be used as the ggplot2 shape aesthetic

title

Plot title.

justDF

If FALSE (default) the plot will be displayed and a ggplot2 object will be returned. If TRUE a data.frame useful will be returned instead.

Details

This function is fashioned after the plot_ordination function in the phyloseq package.

See Also

tsne_phyloseq. add_tsne_to_sample_data.

Examples

1
2
3
4
5
6
library(phyloseq)
data("GlobalPatterns")
tsne_res <- tsne_phyloseq(GlobalPatterns, distance='wunifrac',
  perplexity = 8, verbose=0, rng_seed = 3901)
plot_tsne_phyloseq(GlobalPatterns, tsne_res,
  color = 'SampleType', title='t-SNE (Weighted UniFrac)')

opisthokonta/tsnemicrobiota documentation built on June 1, 2019, 9:44 a.m.