contrast matrix design for a continuous variable
1
0
Entering edit mode
dtzhu337 • 0
@f9182197
Last seen 3 hours ago
United States

Hi all,

I am trying to figure out signals from DNA methylation for a continuous variable at multiple groups. We have mice samples at 4 time points in both sexes, and we are testing if DNA methylation positions respond to V1 using limma

I used the following design matrix and added duplicateCorrelation for random effect. I am asking the following three questions:

  1. which DNA methylation positions respond to V1 in females?
  2. which DNA methylation positions respond to V1 in males?
  3. which DNA methylation positions respond to V1 differently between females and males?
V1 = meta_dat$variable
sex = meta_dat$sex
X = ns(meta_dat$time_point, df = 3)
design = model.matrix(~ 0 + sex + sex:V1 + X)

Q1: Does this design matrix make any sense?

The results from limma gave the following columns

colnames(coef(fit2))
[1] "sexfemale"       "sexmale"         "X1"              "X2"              "X3"             
[6] "sexfemale.V1" "sexmale.V1"

To answer the above questions,

  1. topTable(fit2, coef = 6, n = Inf, adjust.method = "BH")
    
  2. topTable(fit2, coef = 7, n = Inf, adjust.method = "BH")
    
  3. cont_sexdiff = makeContrasts(sexfemale.V1 - sexmale.V1,
                          levels = colnames(coef(fit2)))
    fit_cont = contrasts.fit(fit2, cont_sexdiff)
    fit_cont = eBayes(fit_cont)
    topTable(fit_cont, n = Inf, adjust.method = "BH")
    

Q2: Is my approach appropriate? Thank you.

limma • 375 views
ADD COMMENT
1
Entering edit mode
@gordon-smyth
Last seen 1 hour ago
WEHI, Melbourne, Australia

Yes, the design and contrasts are correct.

Your analysis is also adjusted for covariates defined by X, which I assume is what you want to do.

ADD COMMENT
0
Entering edit mode

Hi Gordon,

Thank you very much for your answer. Actually the variable X is the age, which I am also interested in. Somehow, age and V1 are co-related, that is, with age increases, V1 increases. Hence I wanted to identify DNA methy positions related with V1 adjusted for age/X. Rather than performing two sets of analysis, my plan now is to test DNA methylation positions that respond to age and V1 differently in males and females simultaneously. Hence I came up with the following design matrix:

model.matrix(~ 0 + sex + sex:V1 + sex:X)

By performing contrast, I can identify DNA methylation positions that respond to V1 and age in males, females, average both sexes, and sex differences.

Could you comment on this matrix design? Thank you.

ADD REPLY

Login before adding your answer.

Traffic: 664 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