I'm running DESeq2 for my expression analysis and have a question on the design formula. I have 2 cell lines, 2 time points, and 4 treatments in 3 batches. I tried the following 2 designs to compare the same 2 treatments and the results are slightly different in terms of the number of significant genes and their ranks. Why is that? Are these two models not the same?
1. dds$group <- factor(paste0(dds$cell, ".", dds$time, ".", dds$treat))
design(dds)<- ~ group + batch
dds<-DESeq(dds)
2. design(dds)<- ~ batch + cell*time*treat
dds<-DESeq(dds)
Thanks for the help!
Best,
Wei
Thanks Simon. Take time comparison as an example (I have 2 time points: 3hr and 24hr), this is how I call the results function:
Using the first model:
> results(dds, contrast=c("group","19154.3hr.Typhi","19154.24hr.Typhi"), addMLE=T)
log2 fold change (MAP): group 19154.3hr.Typhi vs 19154.24hr.Typhi
Wald test p-value: group 19154.3hr.Typhi vs 19154.24hr.Typhi
Using the second model:
> results(dds, name="time_3hr_vs_24hr", addMLE=F)
log2 fold change (MLE): time 3hr vs 24hr
Wald test p-value: time 3hr vs 24hr
As I mentioned, the results are slightly different. My dilemma is that: I have to use the first model to make pairwise comparisons, and use the second model to get the 2-way and 3-way interaction terms. Would be nice if I can get all of them using the same model.
Best,
Wei