Description Usage Arguments Value Note Author(s) References Examples
A generalized version of commonly used UniFrac distances. It is defined as:
d^{(α)} = [∑_{i=1}^m b_i (p^A_{i} + p^B_{i})^α |p^A_{i} - p^B_{i}|/(p^A_{i} + p^B_{i})]/ [ ∑_{i=1}^m b_i (p^A_{i} + p^B_{i})^α],
where m is the number of branches, b_i is the length of ith branch, p^A_{i}, p^B_{i} are the branch proportion for community A and B.
Generalized UniFrac distance contains an extra parameter α controlling the weight on abundant lineages so the distance is not dominated by highly abundant lineages. α=0.5 has overall the best power.
1 |
otu.tab |
OTU count table, row - n sample, column - q OTU |
tree |
Rooted phylogenetic tree of R class “phylo” |
alpha |
Parameter controlling weight on abundant lineages |
Return a list containing
d0 |
UniFrac(0) |
d5 |
UniFrac(0.5) |
d1 |
UniFrac(1), weighted UniFrac |
or a list containing
GUniFrac |
The distance matrix for different alpha |
alpha |
The weight |
The time consuming part is written in C and faster than the original one. The function only accepts rooted tree.
Chong Wu <chongwu@umn.edu>
Chen, Jun, et al (2012). "Associating microbiome composition with environmental covariates using generalized UniFrac distances." Bioinformatics 28(16):2106-2113.
1 2 3 4 5 6 7 8 9 | data(throat.otu.tab)
data(throat.tree)
data(throat.meta)
groups <- throat.meta$SmokingStatus
# Calculate the UniFracs
unifracs <- GUniFrac(throat.otu.tab, throat.tree)
unifracs
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.