DESEQ2 results and contrast (and a relevel question)
2
0
Entering edit mode
yg • 0
@yg-7471
Last seen 6.6 years ago
United States

I have a simple2x2 design for RNASeq DEG analysis with DESqe2. When I read the manual I got quite confused by the examples provided for the two conditions,two group design.

 I.  by doing the following, are we trying to find genes expression level differences between conditions A and B or between group Y and X?

"   results(dds, contrast=c("condition","B","A")) "

2. By doing the following, are we only trying to find the interactions between two factors"group" and 'condition"?

" results(dds, name="groupY.conditionB") "

3. What is 0, and 1? I might missed something from the manual?

# the condition effect in group B results(dds, contrast=c(0,0,1,1))

4. Are we trying to find gene expression difference between condition A and B or group Y or X, are we considering the interactions between group and conditions?

# or, equivalently using list to add these two effects results(dds, contrast=list(c("condition_B_vs_A","groupY.conditionB")))

5. Wht the resultNames (dds) only show "groupY.conditionB", what if we want to "groupX. conditionB" or more?

 

Besides, I have a relevel question:

For my 2X2 design, should I relevel both group and condition such as 

dds$group<-relevel(dds$group,"X")

dds$condition<-relevel(dds$condition,"B")

or just need to relevel one? Because the example only did relevel for one factor, I am afraid if I relevel two, the first relevel (condition) will be replaced by the second level of factor (group)? Or not?

Thank you very much

deseq deseq2 • 6.9k views
ADD COMMENT
2
Entering edit mode
@mikelove
Last seen 3 hours ago
United States

Note that DESeq2 for the 2x2 design gives the same model matrix as you would get with any 2x2 linear model with interactions.

The model matrix looks like this (with more rows for replicates):

AX ... 1 0 0 0
AY ... 1 1 0 0
BX ... 1 0 1 0
BY ... 1 1 1 1

You can build the model matrix for the example you refer to in R using this code:

group <- factor(rep(rep(c("X","Y"),each=3),2))
condition <- factor(rep(c("A","B"),each=6))
model.matrix(~ group + condition + group*condition)

So what do these terms do? The first term is the intercept. The second term is the group Y vs X effect specific to condition A. The third term is the condition B vs A effect for group X. And finally, the fourth term is the interaction term. This is the additional effect of B vs A in group Y. Or equivalently, it is the additional effect of Y vs X in condition B.

To answer you questions:

1: this gives the condition effect for the reference level of group, so for the X group. 

2: This tests the interaction term. This answers the question: is the condition effect different across groups?

3: Here we are showing how to specify a numeric contrast. It is described earlier in the manual under the 'contrast' argument section. You can ignore numeric contrasts, if you are not familiar with this kind of specification.

4: This is the condition B vs A effect in group Y. By the way we have defined the terms above, the condition B vs A effect in group Y is the effect in the reference level (group X) and the interaction term.

5: We have only one interaction term in the standard 2x2 model with interaction. This means we only need to test the one interaction term in order to test if the condition effect is different across groups.

This is a standard interaction model, so if you have further questions, you might want to consult a local statistician or statistical reference on interactions in linear models.

ADD COMMENT
0
Entering edit mode

Thanks Micheal. The model matrix definition is easy to understand. I now know what the numerical contrast means. Just want to confirm question 4: This is comparing group Y vs group X (numerator vs denominator) under the condition B vs A ((numerator vs denominator), right?

By the way, do I need to relevel on condition first the on group, or I just need to relevel on one factor?

ADD REPLY
0
Entering edit mode
yg • 0
@yg-7471
Last seen 6.6 years ago
United States

Thanks Micheal. The model matrix definition is easy to understand. I now know what the numerical contrast means. Just want to confirm question 4: This is comparing group Y vs group X (numerator vs denominator) under the condition B vs A ((numerator vs denominator), right?

By the way, do I need to relevel on condition first the on group, or I just need to relevel on one factor?

ADD COMMENT
0
Entering edit mode

"Thanks Micheal. The model matrix definition is easy to understand. I now know what the numerical contrast means. Just want to confirm question 4: This is comparing group Y vs group X (numerator vs denominator) under the condition B vs A ((numerator vs denominator), right?"

No. The additional of these two terms is what I described previously: it is group Y condition B vs group Y condition A. You might benefit from discussing this with a local statistician.

You need to relevel any factors for which you care what the reference level will be (here they are A and wt).

ADD REPLY

Login before adding your answer.

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