Description Usage Arguments Details Value Author(s) References See Also Examples
Quantify microbiota divergence (heterogeneity) within a given sample set with respect to a reference.
1 | divergence(x, y, method = "bray")
|
x |
phyloseq object or a vector |
y |
Reference sample. A vector. |
method |
dissimilarity method: any method available via phyloseq::distance function. Note that some methods ("jsd" and 'unifrac' for instance) do not work with the group divergence. |
Microbiota divergence (heterogeneity / spread) within a given sample set can be quantified by the average sample dissimilarity or beta diversity with respect to a given reference sample.
This measure is sensitive to sample size. Subsampling or bootstrapping can be applied to equalize sample sizes between comparisons.
Vector with dissimilarities; one for each sample, quantifying the dissimilarity of the sample from the reference sample.
Leo Lahti microbiome-admin@googlegroups.com
To cite this R package, see citation('microbiome')
the vegdist function from the vegan package provides many standard beta diversity measures
1 2 3 4 5 6 | # Assess beta diversity among the African samples
# in a diet swap study (see \code{help(dietswap)} for references)
data(dietswap)
pseq <- subset_samples(dietswap, nationality == 'AFR')
reference <- apply(abundances(pseq), 1, median)
b <- divergence(pseq, reference, method = "bray")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.