Question: Comparison of Comparisons with DESeq2
gravatar for dbretta25
3 months ago by
dbretta250 wrote:

I have an experimental design with 4 groups, 6 replicates per group (1 control group "A", and 3 treatment groups "B", "C", and "D").

My design is ~ condition

My code is as follows:

dds <- DESeqDataSetFromMatrix(countData=my.counts, colData=coldata, design= ~ condition)
dds <- estimateSizeFactors(dds)
dds <- DESeq(dds)
[1] "Intercept" "gr_B_vs_A" "gr_C_vs_A" "gr_D_vs_A"

I am not sure how to define some of my comparisons of interest, primarily the comparison of comparisons:

(D - C) - (B - A)

Is it possible to define this contrast from the resultsNames above?

As an aside, I attempted to use the resultsNames to perform one comparison (D - C) in two ways: Once by specifying the "contrast" parameter of the results function like so:

res <- results(dds, contrast=c("condition", "D", "C"))

And again by utilizing the resultsNames like so:

res <- results(dds, contrast=list(c("gr_D_vs_A","gr_C_vs_A"))

I was thinking that they should be equivalent due to (D - A) - (C - A) = D - C, but I obtain different numbers of significant DE Genes from these two methods so it seems like my thinking is incorrect.

I am using DESeq2 version 1.22.2

Thanks for your help,


ADD COMMENTlink modified 3 months ago by Michael Love24k • written 3 months ago by dbretta250
Answer: Comparison of Comparisons with DESeq2
gravatar for Michael Love
3 months ago by
Michael Love24k
United States
Michael Love24k wrote:

There’s a whole section of the DESeq2 vignette on “interactions”, take a look there first.

ADD COMMENTlink written 3 months ago by Michael Love24k

Thanks Michael,

I have read the interaction section of the vignette but I am having trouble taking that information/example and applying it to my design.

Do you have input on whether the two results examples I provided are two ways of performing the same contrast (D - C)? And if they should then have identical results in terms of DE Genes passing an adjusted pvalue cutoff?

ADD REPLYlink written 3 months ago by dbretta250

You should make two new factors, say X and Y,

Such that:

X=0 and Y=0 => condition A


X=1 and Y=1 => condition D

Then test the X:Y interaction term.

ADD REPLYlink modified 3 months ago • written 3 months ago by Michael Love24k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 290 users visited in the last hour