I went through the vignette about interaction terms and would like to understand if I am applying interaction terms correctly and biologically, if I am extracting the correct the terms. Here is the example code from DESeq2 R documentation for two conditions (A, B) and three genotypes (I,II,III). Let A and B be 2 conditions as: placebo and treatment respectively and in case of genotype: I is KO (where, gene X is knock out), II is WT and III is Tg (where, extra copy of gene X is present).
> dds <- makeExampleDESeqDataSet(n=100,m=18)
> dds$genotype <- factor(rep(rep(c("I","II","III"),each=3),2))
> dds
class: DESeqDataSet
dim: 100 18
metadata(1): version
assays(1): counts
rownames(100): gene1 gene2 ... gene99 gene100
rowData names(3): trueIntercept trueBeta trueDisp
colnames(18): sample1 sample2 ... sample17 sample18
colData names(2): condition genotype
> dds$genotype <- factor(rep(rep(c("I","II","III"),each=3),2))
> design(dds) <- ~ genotype + condition + genotype:condition
> dds <- DESeq(dds)
estimating size factors
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
final dispersion estimates
fitting model and testing
> resultsNames(dds)
[1] "Intercept" "genotype_II_vs_I" "genotype_III_vs_I"
[4] "condition_B_vs_A" "genotypeII.conditionB" "genotypeIII.conditionB"
If we go through each and every terms under resultsName(dds)
then:
genotype_II_vs_I
will be the comparison between WT and KO across treatment and placebo,
genotype_II_vs_I
will be the comparison between Tg and KO across treatment and placebo,
condition_B_vs_A
will be the comparison between treatment vs control for genotype I,
genotypeII.conditionB
will be the interaction effect of WT and treatment across genotype III vs genotype I.
genotypeIII.conditionB
will be the interaction effect of WT and treatment across genotype III vs genotype I.
I am interested to get the list of genes that are affected by both gene X and treatment ? How can I better model all the effects like treatment and genotype effect on Tg/WT vs KO ?