HI,
You probably need to define a new factor that comprises a compound of Celltype
and Timepoint
, and then use this in your design formula.
~ Celltype_Timepoint
Then, your comparisons would look like:
A1_vs_A0 <- results(dds, contrast = c('Celltype_Timepoint', 'A1', 'A0'),
independentFiltering = TRUE, alpha = 0.05, pAdjustMethod = 'BH', parallel = TRUE)
A1_vs_A0 <- lfcShrink(dds, contrast=c('Celltype_Timepoint', 'A1', 'A0'), res = A1_vs_A0)
A3_vs_A0 <- results(dds, contrast = c('Celltype_Timepoint', 'A3', 'A0'),
independentFiltering = TRUE, alpha = 0.05, pAdjustMethod = 'BH', parallel = TRUE)
A3_vs_A0 <- lfcShrink(dds, contrast=c('Celltype_Timepoint', 'A3', 'A0'), res = A3_vs_A0)
B3_vs_A3 <- results(dds, contrast = c('Celltype_Timepoint', 'B3', 'A3'),
independentFiltering = TRUE, alpha = 0.05, pAdjustMethod = 'BH', parallel = TRUE)
B3_vs_A3 <- lfcShrink(dds, contrast=c('Celltype_Timepoint', 'B3', 'A3'), res = B3_vs_A3)
There are likely ways to fit a more elaborate model, e.g. via an interaction term, but the way presented above is the easiest / most simple.
Kevin