deseq2: coding 2x2 design
2
1
Entering edit mode
evakfisch ▴ 10
@evakfisch-6962
Last seen 9.5 years ago
United States

Hello:

I am using DESeq2 to analyze gene expression data (counts from Illumina sequencing). 

I have samples from two different populations (A & B) reared in two environments (X & Y). I am interseted in the main effect of population, the main effect of rearing, and the interaction between the two and so have coded my design like so: ~ population + rearing + population:rearing. 

I set my reference population to A and my reference rearing condition to X, but because of the nature of populations and treatments (which occur in the wild and are not lab/drug manipulations) these are somewhat arbitrary.

My question is that, if I understand correctly, when I look at the results for the population comparison doing the following:

resPop <- results(d, name="pop_B_vs_A")

I am only comparing the effect of population in the reference rearing condition, X. 

Instead what I would like to do is examine the effect of population INDEPENDENT of rearing condition, or in other words, considering both rearing conditions simultaneously/average. 

I've tried to read up on this, but haven't been able to find an example of how to code this (other than to simply run the model as ~pop). 

Any guidance is much appreciated. 

eva

 

 

 

deseq2 deseq • 2.6k views
ADD COMMENT
1
Entering edit mode
@mikelove
Last seen 1 day ago
United States

hi Eva,

"when I look at the results for the population comparison doing the following: resPop <- results(d, name="pop_B_vs_A") I am only comparing the effect of population in the reference rearing condition, X."

Yes, you are correct. And the interaction term is the difference between the population effect in Y and the population effect in X. So when you add the interaction effect to the reference level, or base level, effect, you get the population effect in Y. The average population effect would be halfway in between the effect in X and the effect in Y. You can obtain this result table using a numeric contrast. You want a 1 for the population effect in X and a 0.5 for the interaction effect:

resultsNames(dds)
results(dds, contrast=c(0,1,0,0.5))

Make sure the 1 and 0.5 line up with the resultsNames(dds) and the effects mentioned in the paragraph above.

ADD COMMENT
0
Entering edit mode
evakfisch ▴ 10
@evakfisch-6962
Last seen 9.5 years ago
United States

THANK YOU for your help. I was pretty certain I needed a contrast, but I would never have figured that out. 

Just to verify, could I then do something similar to get the overall effect of rearing by using the contrast below?

results(dds, contrast=c(0,0,1,0.5))
ADD COMMENT
0
Entering edit mode

yes, that's the average effect of rearing across populations.

ADD REPLY

Login before adding your answer.

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