Identifying aggregated mediator regions (AMR)
AMR_search.Rd
Identify aggregated methylated regions (AMR) from the P-values from function max2 using a modified comb-p method. Compute the P-value and the FDR for each AMR detected.
Value
res, table of selected AMRs. For each AMR include chromosomic position, P-value, and FDR
data, matrix of all cpg, with annotation and provided P-values
Details
The function uses a modified comb-p method to identify aggregated methylated regions (AMRs).
Examples
data = hdmax2::helper_ex
K=5
## run hdmax2 step1
hdmax2_step1 = hdmax2::run_AS(exposure = data$exposure,
outcome = data$phenotype,
M = data$methylation,
K = K)
#> Running first regression with univariate exposure variable.
#> Running second regression.
#> Running max-squared test.
##Detecting AMR
chr = data$annotation$chr
start = data$annotation$start
end = data$annotation$end
pval = hdmax2_step1$max2_pvalues
cpg = data$annotation$cpg
res.amr_search = hdmax2::AMR_search(
chr = data$annotation$chr,
start = data$annotation$start,
end = data$annotation$end,
pval = hdmax2_step1$max2_pvalues,
cpg = data$annotation$cpg,
seed = 0.7, #Careful to change this parameter when working with real data
nCores = 2)
res.amr_search$res
#> chr start end p fdr
#> 3 1 864893 865027 0.03604853 0.05184658
#> 2 1 858380 858381 0.03901609 0.05184658
#> 4 1 886431 886553 0.04077365 0.05184658
#> 5 1 896773 896774 0.05000351 0.05184658
#> 1 1 854778 855056 0.05184658 0.05184658