Question: Differential Expression with Factorial Design and adjust for Lane+Batch Effect
0
gravatar for Sam
4.0 years ago by
Sam2.5k
New York
Sam2.5k wrote:

Hi, so recently we have got a data back with the following design

Condition Treatment Lane Batch
Case Treated 1 1
Case Treated 2 1
Case Treated 1 4
Control Treated 2 4
Control Treated 1 1
Control Treated 2 1
Case Untreated 1 4
Case Untreated 2 3
Case Untreated 2 2
Control Untreated 2 1
Control Untreated 1 3
Control Untreated 1 2
data.frame(Condition=rep(rep(c("Case","Control"), each=3),2), Treatment=rep(c("Treated", "Untreated"),each=6), Lane=c(1,2,1,2,1,2,1,2,2,2,1,1), Batch=c(1,1,4,4,1,1,4,3,2,1,3,2))

And we would like to test the following

1. Compare effect of treatment in case 

2. Compare effect of treatment in control

3. Compare and contrast the effect of treatment in case when compared to control.

With DESeq, we have used the design ~Batch+Lane+Condition+Treatment+Condition:Treatment where

dds$Condition<- relevel(dds$Condition, ref="Control")
dds$Treatment<- relevel(dds$Treatment, ref="Untreated")

and from reading the documentation of DESeq2 and limma user guide, my understanding is that the following usage of results might provide the desire statistic outcome

1. Compare effect of treatment in case:

results(dds, list(c("Condition_Case_vs_Control","ConditionCase.TreatmentTreated"))) 

2. Compare effect of treatment in control:

results(dds, contrast=c("Treatment", "Treated", "Untreated"))

3. Compare and contrast the effect of treatment in case when compared to control.

results(dds, name="ConditionCase.TreatmentTreated")

Or for 1, will it be better if we 

dds$Condition<- relevel(dds$Condition, ref="Case")

and do

results(dds, contrast=c("Treatment", "Treated", "Untreated"))

instead?

Is my understanding correct? 

 

rna-seq deseq2 • 1.6k views
ADD COMMENTlink modified 4.0 years ago • written 4.0 years ago by Sam2.5k

I'm pretty sure you want "batch" to be a factor (likewise with "lane", though that won't have a big effect in this case)...

ADD REPLYlink modified 4.0 years ago • written 4.0 years ago by Devon Ryan92k

Oh, right, forgot to set them to factor in this snappy. So other than that, is my use of those code correct??

So for example, in 

results(dds, list(c("Condition_Case_vs_Control","ConditionCase.TreatmentTreated"))) 

I am not sure if DESeq2 will return the p-value of effect of treatment in case adjusting for batch and lane or will DESeq2 return the p-value of effect of treatment in case under the base case of batch and base case of lane. What we would like to get will be the former results but are worry that the later is what we get

ADD REPLYlink written 4.0 years ago by Sam2.5k
1

If you include "batch" and "lane" in the design then you will only ever receive results corrected for them. I'd need to double check whether the contrasts you're using do what you want, though, since you're using a factorial design but then aren't asking factorial questions (yes, you can do this, but at least I personally find it more confusing to do that).

ADD REPLYlink written 4.0 years ago by Devon Ryan92k

Thank you Devon, will it be better if the design is:

 ~Batch+Lane+Condition+Condition:Treatment

 

ADD REPLYlink written 4.0 years ago by Sam2.5k
Please log in to add an answer.

Help
Access

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