GUniFrac: Generalized UniFrac distances for comparing microbial...

Description Usage Arguments Value Note Author(s) References Examples

Description

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.

Usage

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

Arguments

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

Value

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

Note

The time consuming part is written in C and faster than the original one. The function only accepts rooted tree.

Author(s)

Chong Wu <chongwu@umn.edu>

References

Chen, Jun, et al (2012). "Associating microbiome composition with environmental covariates using generalized UniFrac distances." Bioinformatics 28(16):2106-2113.

Examples

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

ChongWu-Biostat/MiSPU documentation built on May 6, 2019, 11:18 a.m.