I am having a hard time wrapping my brain around how to structure my results() and if it's even possible.
My design is:
design(dds) = ~ soilmoisture + fungal_tr + soilmoisture:fungal_tr
My understanding for results() is that:
(1) The fungal effect for soilmoisture W (the main effect):
results(dds2, contrast=c("fungal_tr","Fungus1","Sterile_Control")
(2) The fungal effect for soilmoisture D; this is, by definition, the main effect (W) plus the interaction term (the extra fungal effect in soilmoisture D compared to soilmoisture W):
results(dds, list(c("fungal_tr_Fungus1_vs_Sterile_Control","soilmoistureD.fungal_trFungus1"))
The two examples above always compare Fungus 1 to the Sterile Control within W or within D.
However, is it possible to look at the differential expression of Fungus1 between W vs D and still account for the baseline of the sterile control? Or do I have to run DESeq2 like above, and then take the DEG raw counts and rerun DESeq2 to compare the difference between soil moisture?
Thanks Kevin for the quick reply! I thought of using the interaction effect too except I think that doesn't take into consideration the Sterile Control base expression. Ideally we want to compare the differential expression of Fungus 1 between W and D after accounting for the Sterile Control expression in W and D. Does that make sense?
I see what you mean - these questions are frequently asked, as you can probably see. I do think that the Sterile Control is taken into account in the interaction term, though. It is always difficult to put into language what is going on at the level of the model. To describe the interaction term in another way for your data, it would be that the interaction term aims to determine the difference between the fungal effect (Fungus1 vs Control) in W and D, or:
To help, it is acceptable to merge your two factors together into a single factor via
paste()
orpaste0()
and then perform more basic comparisons in this way.You could also ask this on Bioconductor Support forum, where the DESeq2 developer is responsive. If you do this, you could link back to this thread.
I think that the following text from the vignette helps to clarify it: