Hi Mike and community,
I’m using theDESeq2 package for my RNA-seq analysis. I would like to get feedback on the choice of my models and applied contrasts. If there is a better model to answer our questions, I would appreciate any suggestions.
I use a 3-level factor analysis:
Cultivar factor with 2 levels (cult1, cult2)
Time factor with 3 levels (T1, T2, T3)
Treatment factor with 2 levels (Infected, Control) with 3 biological replicates each.
Aim:
1) Effect of treatment on cultivar
2) Effect of time on cultivar
Complication: In order to compare the effect of treatment within and across cultivars, we have to reduce infected samples with control samples before making any comparison for each time point and cultivar. Therefore, I have nested cultivar with time point for my first question, and run full model using Wald test where I have used only interaction terms to compare effect of treatment within and between time points for each cultivar.
I have been wondering if using main effect + interaction term could give me the same control over treatment within each cultivar and time point without nesting?
1) Effect of treatment on cultivar:
My reference levels are in alphabetical order. cult1, Control.
full~Cultivar + Cultivar:Treatment
In order to compare across cultivars while controlling for specific time points, I applied this contrast:
contrast = list(c("Cultivarcult1_t1.TreatmentInf","Cultivarcult2_t1.TreatmentInf")), test = 'Wald', alpha = 0.01)
2) Effect of time on cultivar:
I want to detect genes that are differentially expressed due to time within cultivar and across cultivars, I didn’t nest any variables in the model, I have followed this post: https://support.bioconductor.org/p/101002/.
full ~Cultivar + Treatment + Time + Cultivar:Time
reduced ~Cultivar + Treatment + Time, test="LRT"
Thank you!
Iryna
- Changes were made, ignore this submission.
Thank you so much Michael for your answer!
I just want to make sure I'm correct with building and interpreting my contrasts.
1) Cultivar difference at a time point
reference level is cltv1: difference between cultivars at time point 3
2) Differences for each cultivar at each time point.
reference level cultivar 2: Gives the difference between time3 over reference level cultivar
3) Effect of treatment for each cultivar and time point. Here I'm a bit confused, as the most important comparison to make is contrast between cltv1 vs cltv2. My question is weather I can use only interaction terms to compare treatment effect across cultivars and specific time point (I) ?
base-level is cult2:`Will this contrast give the effect of treatment in cultivar 2 at time 3 vs2 controlling for individual baseline?
Or shall I use main effect + interaction term(II)?`
difference between cult1 vs cult2 at time point 3 including the effect of treatment in the model?
In case I need to use main effect and interaction term, how could I compare between cultivars? For instance, if I have more then 2 cultivars, shall I change base level to get in resultsName the needed main effect (cultivar 3 vs cultivar5), because only main effect Im getting is between cultivar and baseline cultivar. Would appreciate any help!
Thanks in advance,
Iryna
hi Iryna,
The design I suggested is not the easiest for extracting e.g. differences between various groups at every time point. (1) isn't correct as you have it, but rather than risk not getting it right, you can just combine all three factors into one and use ~group for those contrasts. You can take the 'dds' output from a first run using the design I have in my first answer, reassign the design ~group and then just run nbinomWaldTest() without re-running dispersion estimation to do this.
Yes, the (I) line of code you have is defining "effect of treatment in cultivar 2 at time 3 vs 2". You don't add the main effect because it would cancel out.
For your last question, there's not "controlling for treatment" in the interaction model. You have different effects for the two treatments.