Description Usage Arguments Details Value Examples
Fit mixed model to methylation values in one genomic region
1 2 3 4 5 6 7 8 9 10 |
betaOne_df |
matrix of beta values for one genomic region, with row names = CpG IDs, column names = sample IDs |
pheno_df |
a data frame with phenotype and covariates, with variable
|
contPheno_char |
character string of the main effect (a continuous phenotype) to be tested for association with methylation values in the region |
covariates_char |
character vector for names of the covariate variables |
modelType |
type of mixed model, can be |
genome |
Human genome of reference hg19 or hg38 |
arrayType |
Type of array, can be "450k" or "EPIC" |
outLogFile |
Name of log file for messages of mixed model analysis |
This function implements a mixed model to test association between methylation values in a genomic region with a continuous phenotype.
When randCoef
is selected, the model is
methylation M value ~ contPheno_char + covariates_char + (1|Sample) + (contPheno_char|CpG)
.
The last term specifies random intercept and slope for each CpG.
When simple
is selected, the model is
methylation M value ~ contPheno_char + covariates_char + (1|Sample)
In our simulation studies, we found both models are conservative, so p-values are estimated from normal distributions instead of t-distributions.
A dataframe with one row for association result of one region: Estimate
, StdErr
, and
pvalue
for the association of methylation values in the genomic
region tested vs. continuous phenotype contPheno_char
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | data(betasChr22_df)
CpGsChr22_char <- c(
"cg02953382", "cg12419862", "cg24565820", "cg04234412", "cg04824771",
"cg09033563", "cg10150615", "cg18538332", "cg20007245", "cg23131131",
"cg25703541"
)
coMethCpGs <- CoMethSingleRegion(CpGsChr22_char, betasChr22_df)
# test only the first co-methylated region
coMethBeta_df <- betasChr22_df[coMethCpGs$CpGsSubregions[[1]], ]
data(pheno_df)
res <- lmmTest(
betaOne_df = coMethBeta_df,
pheno_df,
contPheno_char = "stage",
covariates_char = c("age.brain", "sex"),
modelType = "randCoef",
arrayType = "450k"
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.