phyloMed: Phylogeny-based test of mediation effect in microbiome...

View source: R/phyloMed.R

phyloMedR Documentation

Phylogeny-based test of mediation effect in microbiome (PhyloMed)

Description

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.

Usage

phyloMed(
  treatment,
  mediators,
  outcome,
  confounders = NULL,
  interaction = FALSE,
  tree,
  pi.method = "product",
  fdr.alpha = 0.05,
  n.perm = NULL,
  verbose = FALSE,
  graph = NULL
)

Arguments

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 NULL.

interaction

An optional logical value. If TRUE, the interaction term between treatment and mediator will be taken into account. Default is FALSE.

tree

A phylogenetic tree (phylo-class object) or a taxonomy table (matrix-class object). The tip labels in the phylogenetic tree or the row names in the taxonomy table should overlap with the column names in the mediators matrix. The column names in the taxonomy table should start from the higher level to lower level, e.g., from kingdom to genus. See Details.

pi.method

An optional character string denotes the method to used in estimate proportion of null. Default method is "product", an alternative method is "maxp". Can be abbreviated.

fdr.alpha

An optional numeric value for the desired FDR significance level in identifying mediating nodes on the tree. Default is 0.05.

n.perm

An optional numeric value for the maximum number of permutations. Default is NULL. See Details.

verbose

An optional logical value. If TRUE, information of the test on each node will be printed. Default is FALSE.

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 "circular" or "rectangular". Can be abbreviated. Default is NULL. See Details.

Details

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.

Value

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 phy_tree or on the rows of the tax_table.

tax_table

The taxonomy table with rows exactly match the taxa in the otu_table. NULL if input tree is a phylogeny tree.

phy_tree

The binary and rooted phylogenetic tree with tips exactly match the taxa in the otu_table: (a) The internal nodes are numbered with value larger than the number of tips; (b) The internal nodes are numbered sequentially, with values increasing away from the root. NULL if input tree is a taxonomy table.

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.

Author(s)

Qilin Hong qhong8@wisc.edu

References

Hong, Q., Chen, G., & Tang, Z. Z. (2023). PhyloMed: a phylogeny-based test of mediation effect in microbiome. Genome Biology, 24(1), 1-21.

Examples

# 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")


KiRinHong/miMediation documentation built on March 31, 2024, 4:31 a.m.