View source: R/phyloseq_mult_dist.R
mult_dissim | R Documentation |
Compute beta diversity for each rarefaction iteration.
mult_dissim(x, method = "bray", average = T, ...)
x |
List of phyloseq objects (result of |
method |
A character string with the name of supported dissimilarity index (see |
average |
Logical; if TRUE, dissimilarity averaged over rarefication iterations will be returned; if FALSE, list of dissimilarity matrices will be returned. |
... |
Additional arguments will be passed to |
List of 'dist'-matrices (if average = FALSE) or a single 'dist' (if average = TRUE).
# Load data
data(esophagus)
sample_sums(esophagus) # samples has different number of sequences
# Perform multiple rarefaction (sample 200 sequences from each sample, repeat the procedure 100 times)
esor <- phyloseq_mult_raref(esophagus, SampSize = 200, iter = 100)
sample_sums(esor[[1]]) # rarefied data
# Estimate sample dissimilarity independently for each iteration
eso_dis <- mult_dissim(esor, method = "unifrac", average = F)
eso_dis[[1]] # unweighted UniFrac distances for the first rarefaction iteration
# Average sample dissimilarities over all rarefaction iterations
eso_dis_avg <- mult_dissim(esor, method = "unifrac", average = T)
eso_dis_avg # mean unweighted UniFrac distances
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.