DESeq2 contrast multiple treated conditions versus multiple control conditions
1
0
Entering edit mode
2.2 years ago
User000 ▴ 690

Dear all,

I have 4 treated and 2 control conditions.

treated1 treated2 treated3 treated4
control1 control2

From my PCA plot I could see that treated1, 2, 3 form a cluster and I want to compare these cluster against both control 1 and 2. I know in DESeq2 for two conditions it is possible to do like this:

res <- results(dds, contrast=c("condition","treated1","control1"), alpha = 0.0001)

But I want to do somethins like in this pseudocode. How to do this in DESeq2?

res <- results(dds, contrast=c("condition","treated1" ,"treated2","treated3" VERSUS "control1","control2")), alpha = 0.0001)

Cross-posted: https://support.bioconductor.org/p/9141807/

RNAseq DESeq2 • 1.5k views
ADD COMMENT
2
Entering edit mode
2.2 years ago

I think you can get results to work with roughly that syntax (check here for examples:https://rdrr.io/bioc/DESeq2/man/results.html)

Or, you can make a new column of colData with contents that groups what you want together, and make that column your design instead of condition.

ADD COMMENT
0
Entering edit mode
(group <- factor(c("treated1","treated1","treated2","treated2","treated3","treated3","treated4","treated4","control1","control1","control2","control2")))
(coldata <- data.frame(row.names=colnames(txi.g), group))
dds <- DESeqDataSetFromTximport(txi.g, colData=coldata, design=~group)
dds <- DESeq(dds)
res <- DESeq2::results(dds, 
               contrast = list(c("treated1","treated2","treated3"),c("control1","control2")), 
               listValues = c(3,-3/5)

This gives me this error, this is because deseq created already the contrasts ie. "condition_treated1_vs_control1" ,With two sample comparison I used to do like this contrast=c("condition","treated1","control1").

Error in checkContrast(contrast, resNames) : 
  all elements of the contrast as a list of length 2 should be elements of 'resultsNames(object)'
ADD REPLY
0
Entering edit mode

also since I have 3 rep each, does this create some problem due to unequal size of samples, ie. 9 treated samples vs 6 o3 controls.

ADD REPLY
0
Entering edit mode

Comparing 6 to 9 samples is not a problem.. As for the rest, read the page I specified to get the correct syntax if you want to do it that way. Or do it the other way.

ADD REPLY

Login before adding your answer.

Traffic: 2249 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