tsne_phyloseq: Dimension reduction of microbiota data with t-SNE

Description Usage Arguments Details Value References See Also Examples

Description

t-Distributed Stochastic Neighbor Embedding (t-SNE) for microbiota data.

Usage

1
2
3
tsne_phyloseq(physeq, distance = "bray", perplexity = 25, dimensions = 2,
  precomputed_distance = NULL, pseudocounts = 1, verbose = 1,
  rng_seed = NULL, philr_options = list(), control = list())

Arguments

physeq

Phylogenetic sequencing data (phyloseq-class).

distance

The dissimilarity measure to use. Either one of bray (default) unifrac, wunifrac, jsd, dpcoa or philr.

perplexity

The perplexity. Usually a number between 5 and 50. Default is 25.

dimensions

The number of dimensions of the t-SNE embedding. Default is 2, which is usually adequate.

precomputed_distance

Matrix or dist object of a precomputed dissimilarity matrix. If you use other ordination techniques or trying different perplexities it will be faster to compute the dissimilarities beforehand.

pseudocounts

The number of psuedocounts, which is added to all elements in the otu table. Only applied when distance is philr.

verbose

The amount of output during the t-SNE estimation. Can be 0 (no output), 1 (some output, including a progress bar) and 2 (detailed output, mostly usefull for debugging purposes)

rng_seed

Provide a seed for generating intiial values for the coordiantes. The final t-SNE result is highly sensitive for starting values, so to get reproducible results you should provide a seed.

philr_options

A list of options to use with philr distances. See 'Details'.

control

A list of control parameters. See the 'Details' section for tsne.

Details

The philr_options argument can conatin two elements, part.weights and ilr.weights. The default is 'enorm.x.gm.counts' and 'blw.sqrt', respectively, since these are used in the philr vignette. See philr for more details.

Value

A list of class tsne_phyloseq.

distance_matrix The distance matrix computed using the method specified in the distance argument.
sne_distance_matrix The SNE dissimilarity matrix computed from the distance_matrix with the perplexity given via the perplexity argument.
names Samples names from the phyloseq object.
tsne A list of class tsne as returned from the tsne function. Contains the t-SNE layout and some fit diagnostics,

References

See Also

plot_tsne_phyloseq, add_tsne_to_sample_data, tsne.

Other dimension reduction methods for microbiota data is available via the ordinate function in the phyloseq package.

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.