Question: DMRcate: incorporating covariates to find DMRs in methylation data?
0
4.1 years ago by
Brian Smith120
United States
Brian Smith120 wrote:

Hi,

I was trying to use DMRcate to find differentially methylated regions in illumina 450k methylation data. However, I need to account for covariates (e.g. age). I usually use the 'lm' function to find t-statistics and p-values associated with each CpG. However, with the DMRcate package, I can't see how I can incorporate the co-variates in the analysis.

Did I miss something?

thanks!

modified 4.1 years ago by Tim Peters80 • written 4.1 years ago by Brian Smith120
Answer: DMRcate: incorporating covariates to find DMRs in methylation data?
0
4.1 years ago by
Tim Peters80
Australia
Tim Peters80 wrote:

Hi Brian,

The DMRcate experimental setup mirrors that of limma, so all you have to do is pass your design matrix (with covariates), contrast matrix (optional) and coefficient of interest to cpg.annotate(), which contains the calls to lmFit() and contrasts.fit() internally. So if you have a binary contrast "mytype" with types "1" and "2" and your covariates "mycovariate1", "mycovariate2" and so on, some boilerplate would be:

type <- factor(mytype)
covariate1 <- as.numeric(mycovariate1)
covariate2 <- as.numeric(mycovariate2)
#etc

design <- model.matrix(~0 + type + covariate1 + covariate2) #etc as needed
cont.mat <- makeContrasts(c=type1-type2, levels=design)
groupanno <- cpg.annotate(myMs, analysis.type="differential", design=design, contrasts=T, cont.matrix=cont.mat, coef="c")

Best of luck,

Tim

According to ?cpg.annotate, this is only possible with array data. I'd like to do the same with WGBS data - is this not possible with DMRcate?

Hi Steven,

This is indeed possible using datatype="sequencing" - please look at the second half of the vignette for a worked example.

Best,

Tim

Edit My bad, I hadn't realised that the example included only contained output from DSS::DMLtest, not DSS::DMLtest.multiFactor. If you use output from DMLtest.multiFactor (and change some of the colnames so that they reflect the output of DSS:DMLtest) then it should work. See the DSS manual for how to incorporate your covariates.

Cheers, Tim