univariate_mediation_DMR: Run mediation analysis on DMR

Description Usage Arguments Details Value Author(s) Examples

View source: R/highmed.R

Description

Estimate various quantities for causal mediation analysis for each DMRs, including average causal mediation effects (indirect effect), average direct effects, proportions mediated, and total effect.

Usage

1
univariate_mediation_DMR(X, Y, DMR, covar = NULL, U = NULL, sims = 3)

Arguments

X

an explanatory variable matrix with n rows and d columns. Each column corresponds to a distinct explanatory variable (Exposure). Explanatory variables must be encoded as numeric variables.

Y

an explanatory variable matrix with n rows and d columns. Each column corresponds to a distinct explanatory variable (Outcome). Explanatory variables must be encoded as numeric variables.

DMR

a matrix of DMRs from the DMR_built() function (DMR_acp).

covar

set of covariable, must be numeric.

U

set of latent factors from multivariate_EWAS() function

sims

number of Monte Carlo draws for nonparametric bootstrap or quasi-Bayesian approximation. 10000 is recommended.

...

argument of the mediate function from the mediation package

Details

We use the mediate() function of the mediation package on the set of selected DMRs. This function makes it possible to estimate their indirect effects and to test their significance.

Value

Tables of results of mediation analyzes for markers with a qValue below the FDR threshold. Indirect effect (ACME - average causal mediation effect), ADE (average direct effect), PM (proportion mediated) and TE (total effect). Composition of tables: estimated effect, confidence interval and mediation pValue.

Author(s)

Basile Jumentier

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
library(highmed)

# Run multivariate EWAS

res <- multivariate_EWAS(X = example$X, Y = example$Y, M = example$M, K = 5)

# Keep latent factors for univariate mediation

U <- res$U

# Run max2

res <- max2(pval1 = res$pValue[, 1], pval2 = res$pValue[, 2])

# lauch DMR_search

res <- DMR_search(chr = example$annotation$chr,
                  start = example$annotation$start,
                  end = example$annotation$end,
                  pval = res$pval,
                  cpg = example$annotation$cpg, nCores = 1)

# lauch DMR_built

tmp <- DMR_built(res, methylation = example$M, nb_cpg = 2)

# Univariate mediation for each DMR

res <- univariate_mediation_DMR(X = example$X, Y = example$Y, DMR = tmp$DMR_acp, U = U, sims = 3)

# Summary plot

plot_summary_DMR(res, tmp)

jumentib/highmed documentation built on Sept. 3, 2020, 2 p.m.