get_GUniFrac | R Documentation |
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))
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. |
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.
Created by Jun Chen; modified by Hua Zou (5/14/2022 Shenzhen China)
https://github.com/cran/GUniFrac/blob/master/R/GUniFrac.R
## Not run:
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
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.