Question: Multiple comparisons with DESeq2
gravatar for spr
3 months ago by
spr0 wrote:


I have a dataset that consists of four conditions (one control, and three different stages of disease) and four batches. 

I accounted for batch effects, by: 

dds <- DESeqDataSetFromTximport(txi.rsem, sampleTable, ~batch + condition)

I then explicitly set the levels of factor condition to make sure every stage is compared to my control. 

dds$condition <- factor(dds$condition, levels=c("Normal","Stage1", "Stage2", "Stage3"))

And performed differential expression: dds <- DESeq(dds). 

My questions are: 

1) Do I need to do anything else to account for batch effects?

2) Having set my "Normal" samples as the reference level, can I expect that every stage has been separately compared to "Normal"? 

3) I am also interested in comparing Stage 2 to Stage 1, Stage 3 to Stage 2 and Stage 3 to Stage 1. Is there a way to code this? I assume I could reset the levels and choose Stage 1 or 2 as reference, then keep only the comparisons that make sense.

Thanks so much for your help!


ADD COMMENTlink modified 3 months ago by Michael Love19k • written 3 months ago by spr0
gravatar for Michael Love
3 months ago by
Michael Love19k
United States
Michael Love19k wrote:

1) No, just using ~batch + condition accounts for batch effects.

2) The coefficients that are built from this setup are against Normal, yes. You can always contrast any two levels using results(dds, contrast=c("condition","...","..."). See the help page for ?results.

ADD COMMENTlink written 3 months ago by Michael Love19k

Thanks so much!

ADD REPLYlink written 3 months ago by spr0

As far as the multiple comparisons go, even if I specify three levels to be compared with Normal, I still get a single column of LFC values. 

Is there a way that I can get three columns, one per each level compared to Normal? 

Interestingly, too, the LFC values seem "flipped", as if I specified the levels in the opposite order. I did dds$condition <- factor(dds$condition, levels=c("Normal","Stage1", "Stage2", "Stage3")), which according to the vignette is correct. 

ADD REPLYlink written 3 months ago by spr0

results() only does one contrast at a time. coef() can be used to get a matrix of model coefficients.  The LFC values from a contrast: (variable, numerator, denominator) give log2 of numerator/denominator.

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


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