Description Usage Arguments Value Author(s) References Examples
nodetest
returns Dirichlet-tree multinomial (DTM) node and triplet test
statistics based on Method-of-Moments (MoM) asymptotic test on each internal node.
1 | nodetest(pstrct, group.data)
|
pstrct |
An object returned from function |
group.data |
A list where each element is a matrix of taxonomic counts(columns) for each sample(rows). The ordering of columns needs to be the same as the ordering of leaves in the phylogenetic tree. |
A list containing the following components:
|
MoM p-value for each internal node using the DTM model. |
|
Triplet test statistics under the DTM model. Each row corresponds to a triplet, where the first three columns contain the node labels and the last column contains the triplet statistic. |
|
Maximum of all triplet statistics. |
Yunfan Tang
Tang, Y., Ma, Li. and Nicolae, D. L. (2017). Phylogenetic Dirichlet-multinomial model for microbiome data. arXiv:1610.08974 [stat.AP].
Wang, T. and Zhao, H. (2017). A Dirichlet-tree multinomial regression model for associating dietary nutrients with gut microorganisms. Biometrics.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(ape)
set.seed(10)
## Generate a random binary phylogenetic tree with 10 leaf nodes
pstrct <- phylostructure(rtree(10))
## Simulate microbiome samples for two groups from multinomial distribution
p1 <- c(rep(0.12, 3), rep(0.08, 3), rep(0.1, 4))
p2 <- p1 + 0.001 * c(c(1, -1), rep(0, 8))
n <- 1000 #Number of sequences in each sample
m <- 200 #Number of samples in each group
group.data <- list(x1 = t(rmultinom(m, n, p1)), x2 = t(rmultinom(m, n, p2)))
## Calculte triplet statistics
nodetest(pstrct, group.data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.