Mediation analysis is of rising interest in clinical trials and epidemiology. The advance of high-throughput technologies has made it possible to interrogate molecular phenotypes such as gene expression and DNA methylation in a genome-wide fashion, some of which may act as intermediaries of treatment, external exposures and life-style risk factors in the etiological pathway to diseases or traits. When testing for mediation in high-dimensional studies like ours (Dai, Stanford, and LeBlanc 2020), properly controlling the type I error rate remains a challenge due to the composite null hypothesis.
Among existing methods, the joint significance (JS) test is an intersection-union test using the maximum p-value for testing the two parameters, though a naive significance rule based on the uniform null p-value distribution (JS-uniform) may yield an overly conservative type I error rate and therefore low power. This is particularly a concern for high-dimensional mediation hypotheses for genome-wide molecular intermediaries such as DNA methylation.
In this R package we develop a multiple-testing procedure that accurately controls the family-wise error rate (FWER) and the false discovery rate (FDR) for testing high-dimensional mediation composite null hypotheses. The core of our procedure is based on estimating the proportions of three types of component null hypotheses and deriving the corresponding mixture distribution (JS-mixture) of null p-values.
We show two examples assessing the mediation role of DNA methylation
in prostate cancer studies. The first study is on assessing the
mediation potential role of DNA methylation in genetic regulation of
gene expression in primary prostate cancer (PCa) samples from The Cancer
Genome Atlas (snp_input
). The second study investigated the
potential mediation of DNA methylation on the effect of exercise
lowering the risk of metastatic Progression
(exercise_input
).
The input data (both snp_input
and
exercise_input
) have two columns. See notation in (Dai, Stanford, and LeBlanc 2020). Column 1
contains the p-values for testing if an exposure is associated with the
mediator (α ≠ 0). Column 2
contains the p-value for testing if a mediator is associated with the
outcome after adjusted for the exposure (β ≠ 0) methylation in exercise
effect on prostate cancer progression in a Seattle-based patient
cohort.
data(snp_input)
dim(snp_input)
#> [1] 69602 2
data(exercise_input)
dim(exercise_input)
#> [1] 47900 2
We first read the input data matrix "input_pvalues"
first. To save time for compiling this vignettes file, we use 10% of
p-values in the input data matrix. To reproduce the figure in the JASA
paper, one need to run the code on the entire data matrix.
input_pvalues <- snp_input
input_pvalues=input_pvalues[sample(1:nrow(input_pvalues),size=ceiling(nrow(input_pvalues)/10)),]
The first step of the procedure is to estimate the proportions of the
three type of null hypotheses using the nullprop
function
nullprop <- null_estimation(input_pvalues)
nullprop
#> $alpha10
#> [1] 0.05203595
#>
#> $alpha01
#> [1] 0.4317707
#>
#> $alpha00
#> [1] 0.475666
#>
#> $alpha1
#> [1] 0.9074367
#>
#> $alpha2
#> [1] 0.527702
We next compute the expected quantiles of the mixture null
distribution of pmax
(maximum of two p-values) using the adjust_quantile
function, with either the approximation method (option
exact=0
) or the exact method (option exact=1
).
This set of quantiles can be used to draw the corrected q-q plot.
pnull1<-adjust_quantile(nullprop$alpha00,nullprop$alpha01,nullprop$alpha10,nullprop$alpha1,nullprop$alpha2,input_pvalues,exact=1)
HDMT provides a function correct_qqplot
to draw the corrected quantile-quantile plot for pmax,
based on the estimated quantile of the mixture null distribution (green
dots) and compared to the standard q-q plot based on the uniform
distribution (red dots).
We can also compute the pointwise estimated FDR for pmax
using the fdr_est()
function, with either the approximation
method or the exact method. The family-wise error rate cut-off can be
computed by the fwer_est()
function.
For this example, we only included 10% of p-values from the genome-wide testing as shown in the paper, due to data storage space limit. We read in the input data matrix with two columns of p-values as follows.
input_pvalues <- exercise_input
#To save time, we use 10% of rows
input_pvalues=input_pvalues[sample(1:nrow(input_pvalues),size=ceiling(nrow(input_pvalues)/10)),]
The estimation procedures are identical to the previous example:
We can compute the null distribution of pmax using the approximation method in Section 2.2 of the paper, and we can also compute the null distribution of pmax using the exact method in Section 2.4.
pnull<-adjust_quantile(nullprop$alpha00,nullprop$alpha01,nullprop$alpha10,nullprop$alpha1,nullprop$alpha2,input_pvalues,exact=0)
pnull1<-adjust_quantile(nullprop$alpha00,nullprop$alpha01,nullprop$alpha10,nullprop$alpha1,nullprop$alpha2,input_pvalues,exact=1)
The Q-Q plot based on the approximation method is shown as follows:
The Q-Q plot based on the exact method is shown as follows:
sessionInfo()
#> R version 4.4.2 (2024-10-31)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 24.04.1 LTS
#>
#> Matrix products: default
#> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so; LAPACK version 3.12.0
#>
#> locale:
#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
#> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=C
#> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
#> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
#> [9] LC_ADDRESS=C LC_TELEPHONE=C
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#>
#> time zone: Etc/UTC
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] HDMT_1.0.5 rmarkdown_2.29
#>
#> loaded via a namespace (and not attached):
#> [1] gtable_0.3.6 jsonlite_1.8.9 compiler_4.4.2 Rcpp_1.0.13-1
#> [5] stringr_1.5.1 jquerylib_0.1.4 splines_4.4.2 scales_1.3.0
#> [9] yaml_2.3.10 fastmap_1.2.0 ggplot2_3.5.1 R6_2.5.1
#> [13] plyr_1.8.9 fdrtool_1.2.18 knitr_1.49 tibble_3.2.1
#> [17] maketools_1.3.1 munsell_0.5.1 bslib_0.8.0 pillar_1.9.0
#> [21] rlang_1.1.4 utf8_1.2.4 cachem_1.1.0 stringi_1.8.4
#> [25] xfun_0.49 sass_0.4.9 sys_3.4.3 cli_3.6.3
#> [29] magrittr_2.0.3 digest_0.6.37 grid_4.4.2 lifecycle_1.0.4
#> [33] vctrs_0.6.5 qvalue_2.39.0 evaluate_1.0.1 glue_1.8.0
#> [37] buildtools_1.0.0 fansi_1.0.6 colorspace_2.1-1 reshape2_1.4.4
#> [41] tools_4.4.2 pkgconfig_2.0.3 htmltools_0.5.8.1