I have an experiment with three treatments (E,U and control (C)) and 2 genotypes (1 and 2).
I have 3-4 reps for each conditions and each genotype.

I know how to do the comparison (E-C vs U-C) for each genotype separately (with "design = ~ treament" and treatment column containing E, C or U). And then I look at the overlap/no overlap between both DEG lists (DEGs E1vsU1 and DEGs E2vsU2).

However, I think there is a better (statiscal) way would to analyze E vs U changes depending on genotype.
In other words, I would like to do the following comparison:

(E1-C1/U1-C1) vs (E2-C2/U2-C2)

which should yield me those genes in the EvsU comparison for genotype 1 that are differentially expressed compared to EvsU comparison for genotype 2.

To get this right, though, you need to have your factor reference levels set correctly.

The other way to get what you want is to create a new variable, called Group, that encodes both the treatment and genotype, and then re-run DESeq2 with that.

These types of questions are probably the most asked here and on Biocondctor forum.

------------------------

In all honesty, though, I prefer to keep these things as simple as possible, unless you have very large sample n. If 'simple' involves generating multiple results tables and comparing them 'manually', then so be it.

I also studied the presented example 2 in ?results, but there are only 2 conditions in that example (while I have three)?
So, it is not clear to me, how I should correctly integrate the controls (C) for each genotype (1 or 2).

Also, I combined treatment and genotype into a new variable called group, and then you can indeed easily compare E1vsU1 or E2vsU2, but how are the C samples then taken into account, and how can you statistically compare E1vsU1 with E2vsU2?

The key point to remember about designs with interaction terms is
that, unlike for a design ~genotype + condition, where the condition
effect represents the overall effect controlling for differences due
to genotype, by adding genotype:condition, the main condition effect
only represents the effect of condition for the reference level of
genotype (I, or whichever level was defined by the user as the
reference level). The interaction terms genotypeII.conditionB and
genotypeIII.conditionB give the difference between the condition
effect for a given genotype and the condition effect for the reference
genotype.

When I am in doubt about these design formulae, I usually spot check some results via box-and-whisker plots just to be sure. Generating quick plots via base boxplot() is easy:

Still twice the number of DEGs compared to the analysis only including control samples, but I assume the extra DEGs are due to the fact that more samples have been included in the analysis (more statiscal power, see e.g. also question herehttps://support.bioconductor.org/p/101190/?

Thank you for suggesting the vignette, but I'm having a hard time understanding these interaction terms.
For example, I also would like to do the following contrasts:

treatment a vs b for genotype 1

and

treatment a vs b for genotype 2

Again I am able to do this in a separate analysis (only analyzing samples for genotype 1 or only analyzing samples for genotype 2), but not when all samples are analyzed together (samples for genotype 1 and 2 loaded in the DE dataset).

Hey, it is 'better' to normalise the entire dataset together, but I think that it is okay to go back to use a different design formula such that you can conduct all comparisons that you need. By normalising all samples together, irrespective of the design formula, the data will always be normalised in the same way. If you remove samples, however, the size factors will change; thus, normalised values will also differ.

If you would know the formule for a vs b for genotype I or for a vs b for genotype II, it would be welcome. This way I can compare how big the difference is when comparing all samples together or a selection of samples only.