Entering edit mode
9.0 years ago
Sam
★
4.8k
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
- Compare effect of treatment in case
- Compare effect of treatment in control
- 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
Compare effect of treatment in case:
results(dds, list(c("Condition_Case_vs_Control","ConditionCase.TreatmentTreated")))
Compare effect of treatment in control:
results(dds, contrast=c("Treatment", "Treated", "Untreated"))
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?
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)...
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
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
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).
Thank you Devon, will it be better if the design is: