DESeq2- design matrix with multiple factors, taking gender into consideration
Entering edit mode
kmu004 ▴ 40
Last seen 2.5 years ago
United States

Hello All,

So, I have some data from a bone deformity study where we believe there is an effect of gender on disease and has to be accounted for before identifying differential regulation. We are also interested in the transcriptional signature on either side of the convexity.

Here is what my example colData looks like

cond    gender  convexity
DIS1    M   left
DIS1    M   right
DIS1    F   left
DIS1    F   right
DIS2    F   left
DIS2    F   right
DIS2    M   left
DIS2    M   right

I am interested in identifying contrasts the following contrasts

  1. Is there a male vs female difference for between left and right convexity in both conditions ( MvsFLeftDis1 and MvsFRightDis1)
  2. The difference in convexity (leftvsRightDis1 and leftvsRightDis2)
  3. Dis1 vs Dis2 (taking into account the convexity and gender covariates)

Using the information in the vignette on interactions (, I combine the gender and condition to a single column and use it in the following model

dds$group <- factor(paste0(dds$convexity, dds$gender_cond))

dds$group=  leftM_dis1, leftF_dis1, rightM_dis1 and so on.

Am I correct in the design of the model?

If yes, the contrasts MvsFleftDis1- can be found by contrast = c("group","leftFdis1", "leftM_dis1"), correct?

How would I extract leftDis1 vs RightDis1 (summing the effect of gender covariate) and Dis1 vs Dis2 contrast ?

If my model is not correct- can some one please guide me with the correct model. I unfortunately don't have access to a local statistician who can help me. So, any help would be greatly appreciated.

Thanks, Kavi

deseq2 multifactor interaction term gender effect 3-factors • 362 views
Entering edit mode
Last seen 3 hours ago
United States

Yes, those contrasts give the M vs F for leftDis1, etc.

Entering edit mode

Then how would I extract the other contrasts such as leftDis1 vs RightDis1 (summing the effect of gender covariate) and Dis1 vs Dis2 contrast ?

Entering edit mode

A similar question was posted yesterday or earlier this week. In an interaction model you don’t have an “average” effect for each covariate. You could instead run a model with only main effects to try to get at this.

Entering edit mode

Hello Michael, Sorry, I don't entirely understand. Do you mean I construct a model with no gender covariate? Just

   dds$group <- factor(paste0(dds$convexity, dds$cond))

But how would I then account for gender?

Entering edit mode

This is discussed in the documentation you would include both covariates in the design


Login before adding your answer.

Traffic: 247 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6