DESeq2 contrast multiple treated conditions versus multiple control conditions
1
0
Entering edit mode
User000 • 0
@ea03770f
Last seen 2.1 years 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 • 2.8k views
ADD COMMENT
0
Entering edit mode
Basti ▴ 780
@7d45153c
Last seen 23 hours ago
France

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

ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode
ADD REPLY

Login before adding your answer.

Traffic: 866 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6