Hi everyone! I’m trying to analyze RNA-seq data using DESeq2 to perform differential expression analysis, but I’m not sure if I’m using the correct design for this type of experiment or if I’m extracting the results correctly. I searched for similar experimental designs but couldn’t find exactly what I needed.
To give you some context: We supplemented a bacterial strain with a fatty acid (Fed condition). As a control, we used cultures supplemented with DMSO (the solvent used to dissolve the fatty acid) to ensure that any changes are due to the fatty acid itself and not the solvent. We harvested cells at two time points: after 30 minutes and after 6 hours of feeding. So, our experiment looks like this:
| sampleName | condition | timepoint |
| ---------- | --------- | --------- |
| DMSO1T1 | DMSO | 30min |
| DMSO2T1 | DMSO | 30min |
| DMSO3T1 | DMSO | 30min |
| Fed1T1 | Fed | 30min |
| Fed2T1 | Fed | 30min |
| Fed3T1 | Fed | 30min |
| DMSO1T2 | DMSO | 6h |
| DMSO2T2 | DMSO | 6h |
| DMSO3T2 | DMSO | 6h |
| Fed1T2 | Fed | 6h |
| Fed2T2 | Fed | 6h |
| Fed3T2 | Fed | 6h |
Since we want to study the effects of both time and feeding, I used this design:
design = ~ timepoint + condition + timepoint:condition
dds <- DESeqDataSetFromMatrix(
countData = cts[, sampleName],
colData = colData,
design = ~ timepoint + condition + timepoint:condition
)
To answer my biological questions, I extracted results like this:
1) Do genes change over time (30min vs 6h), regardless of feeding?
res_time_30vs6 <- results(dds, name = "timepoint_6h_vs_30min")
2) How do genes change after 30 min of feeding (Fed vs DMSO at 30 min)?
res_feeding_30min <- results(dds, name = "condition_Fed_vs_DMSO")
3) How do genes change after 6 h of feeding (Fed vs DMSO at 6 h)?
res_feeding_6h <- results(dds, contrast = list(
c("condition_Fed_vs_DMSO", "timepoint6h.conditionFed")
))
4) Is the effect of feeding different at 6 h compared to 30 min for Fed samples? (interaction)
res_time_fed <- results(dds, contrast = list(c("timepoint_6h_vs_30min", "timepoint6h.conditionFed")))
However, I’m still confused — I’m not sure I fully understand how the interaction works in the design, and I’m worried I didn’t specify the design or contrasts correctly. Can someone help clarify this?
Thank you so much in advance!
Have a look at the contrast and interaction section.
Q1) is difference between 6h and 30min at the reference level of the condition since the interaction term is included in the model.
Thank you so much for the clarification! I hadn’t understood that when I read about the design. With the interaction term, the main effects (like condition_Fed_vs_DMSO or timepoint_6h_vs_30min) are not global effects — they’re interpreted at the reference level of the other factor. Now i got it, thank you!