phyloMed | R Documentation |
phyloMed
enables us to test the mediation effect in high-dimensional microbial composition.
The method leverages the hierarchical phylogeny relationship among different microbial taxa to decompose the
complex mediation model on the full microbial composition into multiple simple independent local mediation models
on subcompositions. The phyloMed
function (a) performs the mediation test for the subcomposition at each internal node
of the phylogenetic tree and pinpoint the mediating nodes with significant test p-values; and (b) combine all subcomposition
p-values to assess the overall mediation effect of the entire microbial community.
phyloMed(
treatment,
mediators,
outcome,
confounders = NULL,
interaction = FALSE,
tree,
pi.method = "product",
fdr.alpha = 0.05,
n.perm = NULL,
verbose = FALSE,
graph = NULL
)
treatment |
A numeric vector of the treatment. |
mediators |
A named numeric matrix containing microbiome abundance. Each row is a subject and each column is a taxon. Column name contains the taxon name. |
outcome |
A numeric vector of continuous or binary outcome. |
confounders |
An optional numeric vector or matrix containing confounders that may affect the
treatment, mediators and outcome.
Each row is a subject and each column is a specific confounder, e.g., age or sex.
Default is |
interaction |
An optional logical value. If |
tree |
A phylogenetic tree ( |
pi.method |
An optional character string denotes the method to used in estimate proportion of null.
Default method is |
fdr.alpha |
An optional numeric value for the desired FDR significance level in identifying mediating nodes on the tree.
Default is |
n.perm |
An optional numeric value for the maximum number of permutations.
Default is |
verbose |
An optional logical value. If |
graph |
An optional character string denotes the layout of the graph, which contains a phylogenetic tree or taxonomic tree with
identified mediating nodes highlighted. Can be |
phyloMed
could leverage phylogeny or taxonomy relationship among taxa.
If the tree
is a unrooted and/or non-binary phylogenetic tree, phyloMed
will preprocess the tree:
(a) root the tree with the longest tip branch as outgroup if it is unrooted; and/or
(b) resolve multichotomies into dichotomies based on the order they appear if it is non-binary.
If the tree
is a taxonomy table, phyloMed
will group taxa based on different levels of taxonomic ranks.
phyloMed
uses the treatment-mediator association test p-value and mediation-outcome association test p-value
to construct the subcomposition mediation test statistic at each local model (Hong et al., Manuscript). The two p-values can come from
either the asymptotic test or the permutation test. Asymptotic test is faster but less accurate when the study sample size is small.
By default (n.perm=NULL
), only asymptotic test will be performed. Otherwise, if n.perm
is set to a positive number,
results from two versions of PhyloMed will be output, one based on the asymptotic p-value and the other based on the permutation
p-value. Graph only highlights the mediating nodes identified from permutation version when both versions are performed.
By default (graph=NULL
), graph will not be plotted.
A phyloseq
-class object named clean.data
and a list named rslt
.
clean.data
contains the following components:
sample_data |
Input treatment, outcome and confounders. |
otu_table |
The abundance data for the taxa that are present on the tips of the |
tax_table |
The taxonomy table with rows exactly match the taxa in the |
phy_tree |
The binary and rooted phylogenetic tree with tips exactly match the taxa in the |
If n.perm
is not NULL
, the function will return two lists in rslt
named PhyloMed.A
and PhyloMed.P
, respectively.
Otherwise, only one list named PhyloMed.A
will be returned.
Each list contains the following components:
node.pval |
A numeric vector of subcomposition mediation p-values for all internal nodes. |
sig.clade |
A list of significant nodes with their descendants. |
null.prop |
A vector of the estimated proportion of different types of null hypotheses across all local mediation tests. |
global.pval |
A global test p-value using harmonic mean. |
If graph
is not NULL
, the phylogenetic or taxonomic tree will be plotted. The layout depends on the input of graph
.
The size of the circle at each internal node is proportional to
-\log_{10}
(subcomposition p-value), the larger circle indicates a smaller p-value. The significant nodes are highlighted by blue rectangle.
Qilin Hong qhong8@wisc.edu
Hong, Q., Chen, G., & Tang, Z. Z. (2023). PhyloMed: a phylogeny-based test of mediation effect in microbiome. Genome Biology, 24(1), 1-21.
# Load real data
data(data.cecal)
# Run test with phylogeny tree
Trt = data.cecal$treatment
M = data.cecal$mediators
Y = data.cecal$outcome
tree = data.cecal$tree
rslt.phylomed = phyloMed(Trt, M, Y, tree = tree, graph = "rectangular")
# Run test with taxonomy table
Trt = data.zeeviD$treatment
M = data.zeeviD$mediators
Y = data.zeeviD$outcome
tree = data.zeeviD$tree
rslt.phylomed = phyloMed(Trt, M, Y, tree = tree, graph = "circular")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.