A generalized version of commonly used UniFrac distances. The unweighted and weighted UniFrac, and variance-adjusted weighted UniFrac distances are also implemented.

get_GUniFrac(
   otu.tab,
   tree,
   alpha = c(0, 0.5, 1))

Arguments

otu.tab

(Required). a matrix, an OTU count table, row - n sample, column - q OTU.

tree

(Required). tree. a rooted phylogenetic tree of R class “phylo”.

alpha

(optional). numeric. the parameter controlling weight on abundant lineages.

Value

a three dimensional array containing all the UniFrac distance matrices.

unifracs: three dimensional array containing the generalized UniFrac distances, unweighted UniFrac distance and variance adjusted UniFrac distances.

References

https://github.com/cran/GUniFrac/blob/master/R/GUniFrac.R

Author

Created by Jun Chen; modified by Hua Zou (5/14/2022 Shenzhen China)

Examples


if (FALSE) {
data("cid_ying")
otu.tab <- phyloseq::otu_table(cid_ying)
tree <- phyloseq::phy_tree(cid_ying)

unifracs <- get_GUniFrac(otu.tab, tree, alpha=c(0, 0.5, 1))$unifracs

dw <- unifracs[, , "d_1"]    # Weighted UniFrac
du <- unifracs[, , "d_UW"]   # Unweighted UniFrac
dv <- unifracs[, , "d_VAW"]  # Variance adjusted weighted UniFrac
d0 <- unifracs[, , "d_0"]    # GUniFrac with alpha 0
d5 <- unifracs[, , "d_0.5"]  # GUniFrac with alpha 0.5

}