Entering edit mode
I have 4 treated and 2 control samples each 3 reps. I would like to contrast treated 1,2,3 against 2 controls, and treated 4 against 2 controls.
(condition <-factor(c("treated1","treated1","treated2","treated2","treated3","treated3","treated4","treated4","control1","control1","control2","control2")))
(coldata <- data.frame(row.names=colnames(txi.g), condition))
dds <- DESeqDataSetFromTximport(txi.g, colData=coldata, design=~condition)
dds <- DESeq(dds)
res <- DESeq2::results(dds,
contrast = list(c("treated1","treated2","treated3"),c("control1","control2")),
listValues = c(3,-3/5)
But, I get the following error
Error in checkContrast(contrast, resNames) :
all elements of the contrast as a list of length 2 should be elements of 'resultsNames(object)'
I guess this is because "condition" is missing, but I am a bit confused how to do contrast with multiple arguments. I used this link as a guide: DESeq2: one condition vs multiple combined
I did that already:
"condition_treated1_vs_control1", "condition_treated2_vs_control2","condition_treated3_vs_control1",
and so on.Indeed it does not match, you may find a solution to your design here : DESeq2 contrast with list no longer works: all elements of the contrast as a list of length 2 should be elements of 'resultsNames(object)'