DESeq2 contrast multiple treated conditions versus multiple control conditions
1
0
Entering edit mode
User000 • 0
@ea03770f
Last seen 12 weeks ago
Italy

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

RNASeq DESeq2 • 327 views
0
Entering edit mode
Basti ▴ 280
@7d45153c
Last seen 9 hours ago
France

I think the error message is explicit, you should check resultsNames(dds) and match the elements names in your contrast argument

0
Entering edit mode

I did that already: "condition_treated1_vs_control1", "condition_treated2_vs_control2","condition_treated3_vs_control1",and so on.

0
Entering edit mode