This is a test version of Biostars. For the public version, visit https://www.biostars.org.
DESeq2- comparing treatments in repeated experiment

Hi all,

I have an experiment where I am testing gene expression in a plant during infection with 2 different pathogen isolates (TreatmentA and TreatmentB). We performed the experiment in two sets 1 month apart, where we sequenced TreatmentA and a control in set 1 and TreatmentB with a control in set 2. The experimental process was exactly the same just repeated a month apart with a different treatment. enter image description here

While I am able to successfully compare each treatment with the control from it's respective batch, I am wondering what the best way to compare TreatmentA to TreatmentB is. Should I do this with batch built into the design and then just simply compare:

dds_final <- DESeqDataSet(dds, design = ~ Batch + Condition)
results(dds_final, contrast=c("Condition", "TreatmentA" , "TreatmentB"))

Or is this not valid since they have different controls? In which case I was thinking I will just compare signficnalty expressed genes during TreatmentA to TreatmentB and find some specific genes of interest this way.

Sorry if this has already been addressed elsewhere. I’m new to this type of analysis and finding it challenging to translate existing answers to my specific experimental setup.

batch-effect deseq2

Are the controls the same between batches in terms of the experimental procedure?

Yes both controls used the same protocol in terms of healthy plant samples at the same growth stage, tissue sampled, time of day sampled etc., however I assume there would be some batch effects due to possible temperature differences in the different months etc.

Good. So you can do as you said in your question, using contrast=c("Condition", "TreatmentA" , "TreatmentB"). The repeated controls in each batch will allow estimation of the batch effect, so the comparison between treatments is possible.

2 answers

Comparing TreatmentA and TreatmentB directly should be fine, as long as you include the control samples and batch in the design. Effictively the design will use the control samples to estimate the batch (or the batch coefficient will, effectively, be the difference between the controls).

This is probably the easiest way to encode this comparison. The alternative is as omprakash24d suggests: effectively make the contrast

(TreatmentA - Control1) - (TreatmentB - Control2)

In this design they are mathamatically identical, and which you use is just a matter of taste and convenience.

Perfect. Thanks so much for your help!

Because your treatments are nested entirely within different batches, a direct comparison using ~ Batch + Condition will fail due to linear dependency (the model cannot distinguish between "Treatment B" and "Batch 2").

Use the "Group" approach. Combine Condition and Batch into one factor (e.g., Control_B1, TreatA_B1, etc.) and use a numeric contrast or a list contrast in the results() function. This allows you to compare the relative change of Treatment A vs. its control against Treatment B vs. its control, effectively using the shared "Control" state as a bridge to subtract the batch effect.

Condition isn't nested within batch because of the controls. The model matrix will have columns for TreatmentA and TreatmentB and batch, and no linear combination of the Treatment columns will give the batch column.

Log in to answer this question.