Hi Everyone,
I'm using Deseq2 to find out the differentially expressed genes between treatments at the end of a 2x2 crossover study. I went through the Deseq2 vignette and forums but was not able to find example using this specific design.
My colData looks like this:
Subject Treatment Time Sequence
S1 T1 Pre T1-T2
S1 T1 Post T1-T2
S1 T2 Pre T1-T2
S1 T2 Post T1-T2
S2 T2 Pre T2-T1
S2 T2 Post T2-T1
S2 T1 Pre T2-T1
S2 T1 Post T2-T1
As i said, i'd like to test for the genes that are significantly changed between the two treatments (T1 vs T2) at the end of the study (Post). Does the following design seem appropriate for this purpose?
~ Subject + Treatment + Time + Time*Treatment
And if so, what contrast from resultsNames
should i use?
Thank you so much for your reply!
LD
Time*Treatment
is equivalent toTime + Treatment + Time:Treatment
, so your formula as written should beSubject + Treatment*Time
.Let's say that your base factor levels are T1 and Pre using this formula. The interaction term will model the comparison of (T2_pre - T1_pre) - (T2_post - T1_post), which means it will return genes whose fold change difference between the two treatment regimes changes over time (while controlling for subject and main effects). Is this the comparison you wanted?
Thanks a lot for your quick reply rpolicastro!
Thank you for the clarification on the formula. Sorry, I may not have made it clear enough but i don't want to identify genes that change over time but genes which have a significant T1 vs T2 fold change at final time point (=Post). So, what contrast or name should I use in the
results()
function to get these genes (as you mentioned, i'd use T1 and Pre as base factor levels)?