genotype not in your design formula, too, and should that not be included as an additional interaction term with
I think that Example 2 from
?results should fit your needs in most cases, no?
## Example 2: two conditions, two genotypes, with an interaction term
dds <- makeExampleDESeqDataSet(n=100,m=12)
dds$genotype <- factor(rep(rep(c("I","II"),each=3),2))
design(dds) <- ~ genotype + condition + genotype:condition
dds <- DESeq(dds)
# Note: design with interactions terms by default have betaPrior=FALSE
# the condition effect for genotype I (the main effect)
# the condition effect for genotype II
# this is, by definition, the main effect *plus* the interaction term
# (the extra condition effect in genotype II compared to genotype I).
results(dds, list( c("condition_B_vs_A","genotypeII.conditionB") ))
# the interaction term, answering: is the condition effect *different* across genotypes?
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
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.