Designing linear model matrix (limma) for differential methylation analysis using Illumina EPIC Methylation Array
0
0
Entering edit mode
3.1 years ago

Hey everyone!

I am working with methylation data (Illumina EPIC Methylation array) and I was wondering how I should go about designing my linear model matrix to observe differential methylation in the data.

I am performing a basic Case vs. Control study where I am comparing the control methylation to the case and observing the results.

Currently, I am using this line of code to design the matrix.

status <- factor(targets$Status)
design <- model.matrix(~status, data=targets)
colnames(design) <- c(levels(status))
design

  Case Control
1    1       0
2    1       0
3    1       0
4    1       1
5    1       1
attr(,"assign")
[1] 0 1
attr(,"contrasts")
attr(,"contrasts")$status
[1] "contr.treatment"

After this, I create a "contrast matrix" to observe pairwise contrasts in the data set but I am not sure if a contrast matrix is even necessary for this as we are just comparing Case vs. Control.

contMatrix <- makeContrasts(Control - Case,levels=design)
contMatrix

         Contrasts
Levels    Control - Case
  Case                -1
  Control              1

I would really appreciate it if anyone could point me in the right direction on how I should be going about designing the matrix. I would also appreciate if anyone could help me design the matrix when we have multiple factors like Age, Sex etc. along with the Case - Control status.

Thank you.

EPICarray microarray DifferentialMethylation • 1.6k views
ADD COMMENT
1
Entering edit mode

Hello, in the case you have only a simple comparison case-control you don't need a constrast matrix indeed. However you need to pay attention to your design matrix as you renamed the intercept column with "Case" and your variable of interest with "Control" and you are confusing the principles of linear regression; Everything about design matrix is very well explained here paragraph 4: https://bioconductor.org/packages/release/workflows/vignettes/RNAseq123/inst/doc/designmatrices.html#design-matrices-with-and-without-intercept-term

ADD REPLY

Login before adding your answer.

Traffic: 2517 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6