I was wondering how one can do a deseq2 analysis of multiple time points when trying to test for a WT vs TREAT difference at any of the given times. Let's say I have three time points (1h,2h,3h) and two conditions (WT, TREAT)
In edgeR one can create a contrast matrix and pass the complete matrix to the glm() function.
con<- makeContrasts(
TP1.WTvs.T = T1.T - T1.WT,
TP2.WTvs.T = T2.T - T2.WT,
TP3.WTvs.T = T3.T - T3.WT, levels=design)
glmQLFTest(fit, contrast = TP1.WTvs.T) # single TP comparison
glmQLFTest(fit, contrast = con) # compare all time points in one go.
With this contrast matrix i can call each contrast separately to detect genes differentially expressed in each of the single time-points or to compare changes in all TP.
I'm interested to understand how this can be done using the DESeq2
package.
I know i can use the interaction terms after running the results()
command. something like:
resultsNames(ddsTC)
## [1] "Intercept" "strain_T_vs_WT" "time_TP1_vs_TP0" "time_TP2_vs_TP0"
## [5] "..." "..." "..." "strainT.timeTP1"
## [9] "strainT.timeTP2" ...
By calling results(dds, name="time_TP2_vs_TP0")
I can detect all genes in WT whcih ae changed between TP2
and TP0
.
The call for results(dds, name="strainT.timeTP1")
will test if the Treat vs WT fold change is different at TP1
than at TP0
.
Where i'm not sure is by following this logic, how can I do the same I did with edger
?
How do I identify genes which are changed across all three time points?
thanks Assa
thanks Michael for the fast response.
so transferring it from the workflow, something like this should do it for me?
Does this apply only for cases where I have separate WT and treated samples for each of the time points?
Yes.
Yes, you need WT and treated samples at every time point.
great. Is there an interaction where I can look for genes with significant changes in all time points? I mean a constant trendover all time points>
great. Is there an interaction where I can look for genes with significant changes in all time points? I mean a constant trend over all time points>
great. Is there an interaction where I can look for genes with significant changes in all time points? I mean a constant trend over all time points?
There's not really a term for that. You may want to meet with a statistician if you have further questions about how the linear model coefficients in a two group time series work.
Let's say I have this sample information
And I'm analyzing this with
Wald
andLRT
to get the following interaction termsand than again
In the above test I compare the timepoints and conditions on a pair-wise basis. In the second one I use the LRT test model.
"condtion_KO1_vs_WT"
gives me genes changed over all timepoints between KO1 and WT,"condtionKO1.timepoint1h"
would give me the differences between KO1 vs WT at TP1, controlling for baseline.What would be the difference between
res1
andres.lrt.1
? and more importantly, which of the two options would make more sense to analyze?Hi Assa,
I would recommend at this point that you consult with a statistician. I don't have unlimited time for the support site, and so I need to restrict myself to software related questions. Your questions are important, but they have to do with linear modeling, and how different designs answer different questions. If the documentation and workflows we have is not sufficient to bridge the gap, what you would benefit from is to sit down with a statistician or anyone with experience in linear modeling, and they can explain how different coefficients work in a linear model.
thank you for the time.