Build AMR vector
AMR_build.Rd
Build AMR from the result of function AMR_search
Value
A set of build AMRs.
res, selected AMR
CpG_for_each_AMR, list of markers present on each AMR.
AMR_acp, first components of PCA for each DMR
AMR_mean, mean value of CpG on the AMR
Details
We use the series of pValues (one pValue per CpGs) obtained with the mEWAS regression method and the combination of pValue max2. To determine the potential AMRs used the combp method present in the ENmix package (Xu et al. 2016). This method uses the Fisher method to combine the pValues and also the base pair distance (bP) between CpGs (1000 bP maximum between nb_cpg CpGs on the same AMR). The information for each AMR is summarized by doing the mean (by row) of each CpG.
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
res.arm_build = hdmax2::AMR_build(res.amr_search,
methylation = data$methylation, nb_cpg = 2)
#List of DMR selected
head(res.arm_build$res)
#> DMR chr start end p fdr nb
#> 1 DMR1 1 886431 886553 0.04077365 0.05184658 3
#> 2 DMR2 1 854778 855056 0.05184658 0.05184658 6
## CpG in the DMR
res.arm_build$CpG_for_each_AMR
#> $DMR1
#> [1] "cg20322444" "cg07983659" "cg11733071"
#>
#> $DMR2
#> [1] "cg08029603" "cg16347928" "cg22699361" "cg03890988" "cg21786289"
#> [6] "cg13897241"
#>