I have an experimental design with 4 groups, 6 replicates per group (1 control group "A", and 3 treatment groups "B", "C", and "D").
My design is ~ condition
My code is as follows:
dds <- DESeqDataSetFromMatrix(countData=my.counts, colData=coldata, design= ~ condition) dds <- estimateSizeFactors(dds) dds <- DESeq(dds) resultsNames(dds)  "Intercept" "gr_B_vs_A" "gr_C_vs_A" "gr_D_vs_A"
I am not sure how to define some of my comparisons of interest, primarily the comparison of comparisons:
(D - C) - (B - A)
Is it possible to define this contrast from the resultsNames above?
As an aside, I attempted to use the resultsNames to perform one comparison (D - C) in two ways: Once by specifying the "contrast" parameter of the results function like so:
res <- results(dds, contrast=c("condition", "D", "C"))
And again by utilizing the resultsNames like so:
res <- results(dds, contrast=list(c("gr_D_vs_A","gr_C_vs_A"))
I was thinking that they should be equivalent due to (D - A) - (C - A) = D - C, but I obtain different numbers of significant DE Genes from these two methods so it seems like my thinking is incorrect.
I am using DESeq2 version 1.22.2
Thanks for your help,