Hello all,
I am new to RNA-Seq analysis and working on an experiment with three treatments compared to a control at three time points. The comparisons are structured as follows:
Reference Treatment A Treatment A+B
Vehicle day 1 vs Treatment A at day 1 vs Treatment A+B at day 1
vehicle day 3 vs Treatment A at day 3 vs Treatment A+B at day 3
Vehicle day 7 vs Treatment A at day 7 vs Treatment A+B at day 7
I created a sampleTable and design to mimic the experimental setup as follows:
sampleTable <- data.frame(
Condition = factor(rep(c("Veh", "A", "AB"),each=9)),
Time = factor(rep(c("1 day", "3 days", "7 days"), each = 3,time=3))
)
rownames(sampleTable) <- colnames(txi$counts)
design <- ~Condition + Time + Condition:Time
dds.temp <- DESeqDataSetFromTximport(txi,colData = sampleTable,design = design)
dds.temp2 <- dds.temp
dds.temp2$Condition <- relevel(dds.temp2$Condition,ref="Veh")
dds.temp2 <- DESeq(dds.temp2,test = "LRT",reduced = ~ Condition + Time)
data.frame(resultsNames(dds.temp2))
However, the resulting resultsNames are as follows:
resultsNames.dds.temp2.
Intercept
Condition_AB_vs_Veh
Condition_A_vs_Veh
Time_3.days_vs_1.day
Time_7.days_vs_1.day
ConditionAB.Time3.days
ConditionA.Time3.days
ConditionAB.Time7.days
ConditionA.Time7.days
I believe I am missing something, as I would like to show expression changes for each treatment compared to the control (Vehicle) at each time point. Any guidance on how to properly structure the design or extract these comparisons would be greatly appreciated!
Thanks James for the prompt answer! your explanation makes more sense. in your example, when creating the interactions:
"AB_3_days" & "A_3_days" would be the reference for "AB_1_day" & "A_1_day" ?
The other thing I forgot to mention is that you need to specify a cell means model to
DESeq
. Here's an example.I am not sure you can strip the prepended 'condition' which is annoying. Now an interaction is (AB_3 - AB_1)-(A_3 - A_1), and will identify those genes that have a different response between day 3 and 1 depending on the treatment. You can get the interaction by either specifying that using a list, or a vector of 1 and -1.
Note that the order of the 1s in the second formulation follows the order of the
resultsNames
, so I am computing A_1 - A_3 - AB_1 + AB_3, which is algebraically identical to the interaction I presented above.I also don't think about anything being a reference per se, although I guess you could call the day 1 observations 'the references' because they are the comparators for the day 3 observations.
Thanks James, I went ahead and fit the model for cell means as so:
However, instead of factoring the conditions, could another approach be to run pairwise comparisons separately? In this case, I would generate objects for res1, res2, ..., res6. Then, I would subset each for significant genes, create a list from these subsets, and draw the heatmap using the log-normalized dds object.
You could do that, but if we assume the within-group variability is similar across groups, you gain power by fitting a single model and extracting contrasts.