mult_dissim: Compute beta diversity for each rarefaction iteration.

View source: R/phyloseq_mult_dist.R

mult_dissimR Documentation

Compute beta diversity for each rarefaction iteration.

Description

Compute beta diversity for each rarefaction iteration.

Usage

mult_dissim(x, method = "bray", average = T, ...)

Arguments

x

List of phyloseq objects (result of phyloseq_mult_raref)

method

A character string with the name of supported dissimilarity index (see distanceMethodList)

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 distance

Value

List of 'dist'-matrices (if average = FALSE) or a single 'dist' (if average = TRUE).

Examples

# 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


vmikk/metagMisc documentation built on June 20, 2024, 7:20 a.m.