nodetest: DTM Triplet Statistic for Cross-group Testing of Mean...

Description Usage Arguments Value Author(s) References Examples

View source: R/nodetest.R

Description

nodetest returns Dirichlet-tree multinomial (DTM) node and triplet test statistics based on Method-of-Moments (MoM) asymptotic test on each internal node.

Usage

1
nodetest(pstrct, group.data)

Arguments

pstrct

An object returned from function phylostructure.

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.

Value

A list containing the following components:

MoMp

MoM p-value for each internal node using the DTM model.

tripletstat

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.

w

Maximum of all triplet statistics.

Author(s)

Yunfan Tang

References

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.

Examples

 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)

yunfantang/PhyloScan documentation built on May 4, 2019, 7:44 p.m.