The makeContrasts
function is from edgeR so it does not help here. If you want to compare one group vs the average of several others here is a suggestion of how this could be done. It uses a design without intercept so all groups are easily accessable as coefficients in resultsNames(dds)
:
suppressMessages(library(DESeq2))
#/ Example with four groups
set.seed(1)
dds <- makeExampleDESeqDataSet(m=12)
dds$condition <- factor(as.character(rep(LETTERS[1:4], each=3)))
#/ Use a design without intercept so all four groups are accessable as coefficients
design(dds) <- ~0+condition
dds <- DESeq(dds)
#> estimating size factors
#> estimating dispersions
#> gene-wise dispersion estimates
#> mean-dispersion relationship
#> final dispersion estimates
#> fitting model and testing
#/ results using listValues to get A vs the average ov B,C,D
res <- results(dds, contrast=list(c("conditionA"), c("conditionB", "conditionC", "conditionD")), listValues=c(1, -1/4))
Created on 2022-06-21 by the reprex package (v2.0.1)
Determining whether or not it is appropriate to do this in a particular situation is up to you. You have to know what question you want to answer for your work. I cannot help with that.