I recently used edgeR for differential analysis and I just had something I couldn't figure out. Background: I have 23 samples (treated with H2O2 and not treated; 0h, 3h, 6hr, 9hr). Unequal number of replicates. So essentially, my groups looked like this:
> group  None.0hr None.0hr None.0hr None.0hr None.3hr None.3hr None.3hr None.3hr None.6hr None.6hr None.6hr None.6hr  None.9hr H2O2.3hr H2O2.3hr H2O2.3hr H2O2.3hr H2O2.6hr H2O2.6hr H2O2.6hr H2O2.6hr H2O2.9hr H2O2.9hr
So when it came to doing makeContrast, I had to decide which ones I wanted to compare, right? So I first chose to compare none.3hr with none.0hr, none.6hr with none.0hr, and none.9hr with none.0hr. This was just to make sure that there were no differential expressions going on throughout those time points.
Next, I did pairwise comparisons of treated vs not treated at the same time points. So: H2O2.3hr with none.3hr, H202.6hr with none.6r, and H2O2.9hr, with none. 9hr. I also then compared those treated samples with none.0hr.
Ultimately, my question is, does this seem valid? My doubt comes from the edgeR user guide. In section 3.3.1, it shows this:
> my.contrasts <- makeContrasts( + Drug.1vs0 = Drug.1h-Drug.0h, + Drug.2vs0 = Drug.2h-Drug.0h, + Placebo.1vs0 = Placebo.1h-Placebo.0h, + Placebo.2vs0 = Placebo.2h-Placebo.0h, + DrugvsPlacebo.0h = Drug.0h-Placebo.0h, + DrugvsPlacebo.1h = (Drug.1h-Drug.0h)-(Placebo.1h-Placebo.0h), + DrugvsPlacebo.2h = (Drug.2h-Drug.0h)-(Placebo.2h-Placebo.0h), + levels=design)
Why was comparing the drug vs placebo at 1 hour computed like that? Why is it (Drug.1h-Drug.0h)-(Placebo.1h-Placebo.0h) and not simply Drug.1h-Placebo.1h?