Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

JSD

Calculate the Jensen-Shannon Divergence (distance)


Description

This is a phyloseq-specific implementation of the Jensen-Shannon Divergence for comparing pairs of microbial communities (samples) in an experiment. The expectation is that you have many samples (say. more than two) and you want a distance matrix on which will perform further analysis. JSD is intended to be “wrapped” by the more general distance function in phyloseq, and it can be invoked using "jsd" as the argument to the method parameter of distance.

Usage

JSD(physeq)

Arguments

physeq

(Required). phyloseq-class. The phyloseq data on which to compute the pairwise sample distance matrix.

Details

One of the motivations for providing JSD in phyloseq was its recent use in the analysis of the enterotype dataset.

Value

An object of class “dist” suitable for certain ordination methods and other distance-based analyses. See distance.

Author(s)

Susan Holmes susan@stat.stanford.edu. Adapted for phyloseq by Paul J. McMurdie.

References

Jensen-Shannon Divergence and Hilbert space embedding. Bent Fuglede and Flemming Topsoe University of Copenhagen, Department of Mathematics http://www.math.ku.dk/~topsoe/ISIT2004JSD.pdf

See Also

Examples

# library(doParallel)  # Do this and next line only if you have multi-cores
# registerDoParallel(cores=6)
# data(enterotype)
# # ent.jsd <- JSD(enterotype, TRUE) # internal only
# ent.jsd <- distance(enterotype, "jsd", parallel=TRUE)
# ent.PCoA <- ordinate(enterotype, "PCoA", ent.jsd) # Perform principle coordinate analysis
# p <- plot_ordination(enterotype, ent.PCoA, color="Enterotype", shape="SeqTech") 
# (p <- p + geom_point(size=5, alpha=0.5))

phyloseq

Handling and analysis of high-throughput microbiome census data

v1.34.0
AGPL-3
Authors
Paul J. McMurdie <joey711@gmail.com>, Susan Holmes <susan@stat.stanford.edu>, with contributions from Gregory Jordan and Scott Chamberlain
Initial release
2019-04-23

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.