I am having a hard time wrapping my brain around how to structure my results() and if it's even possible. Full disclosure, I posted this same question on Biostars and it was suggested I ask here for further clarification and link any additional information given here to that post as well. I am also asking some additional questions below after thinking about it more.
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? Basically I am interested in this:
[D] [W]
(Fungus1 vs Sterile_Control) - (Fungus1 vs Sterile_Control)
I as well as the gentleman who helped me on Biostars were thinking simply calling the interaction term would accomplish this, based on the vignettes:
results(dds, name = 'fungal_tr_Fungus1.soilmoistureD')
However, I am worried the interaction term will not account for the reference level of the fungaltr(SterileControl) for each soilmoisture level (W and D).
One last question I had was that if you can use the interaction term and it does account for the reference level of the fungal_tr, how is it doing it? Is it subtracting the Sterile Control counts first? Is the subtraction it based on the Sterile Control counts or the expression change (LFC) relative to the Fungal1 in W and in D? Let me know if I need to clarify this last question! I would really like to understand the math behind how the model is working.
Just to clarify so I understand your answer:
When calling the interaction term, in addition for accounting the baseline condition between the D and W treatments (the reference level being W), does it also account for ref level of fungal_tr (which is Sterile Control)?
Thank you for taking the time in answering my questions!
Yes, I think also I answered that above...