Description Usage Arguments Details Value Examples
Longitudinal UniFrac distances for comparing changes in microbial communities across 2 time points.
1 2 3 4 5 6 7 8 |
otu.tab |
OTU count table, containing 2*n rows (samples) and q columns (OTUs) |
metadata |
Data frame with three columns: subject identifiers (n unique values), sample identifiers (must match row names of otu.tab), and time or group indicator (numeric variable, or factor with levels such that as.numeric returns the desired ordering). Column names should be subjID, sampID, time. |
tree |
Rooted phylogenetic tree of R class "phylo" |
gam |
Parameter controlling weight on abundant lineages. The same weight is used within a subjects as between subjects. |
paired |
Logical indicating whether to use the paired (TRUE) or longitudinal (FALSE) transformation. |
check.input |
Logical indicating whether to check the function input values for formatting or entry errors (default TRUE). |
Based in part on Jun Chen & Hongzhe Li (2012), GUniFrac.
Computes difference between time points and then calculates difference of these differences, resulting in a dissimilarity matrix that can be used in a variety of downstream distance-based analyses.
Returns a (K+1) dimensional array containing the longitudinal UniFrac dissimilarities with the K specified gamma values plus the unweighted distance. The unweighted dissimilarity matrix may be accessed by result[,,"d_UW"], and the generalized dissimilarities by result[,,"d_G"] where G is the particular choice of gamma.
1 2 3 4 5 6 7 | data("bal.long.otus")
data("bal.long.meta")
data("sim.tree")
D2.unifrac <- LUniFrac(otu.tab = bal.long.otus, metadata = bal.long.meta,
tree = sim.tree, gam = c(0, 0.5, 1), paired = FALSE, check.input = TRUE)
D2.unifrac[, , "d_1"] # gamma = 1 (quantitative longitudinal transformation)
D2.unifrac[, , "d_UW"] # unweighted LUniFrac (qualitative/binary longitudinal transf.)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.