I am confused about multiple factor design and contrasting following differential expression analysis. I've been reading posts about this topic (e.g., DESeq2 design with multiple conditions ), but I wanted some clarification.
My experimental design is as follows: Two breeds of cows (HA and CA). Within each breed, there is an infected and uninfected group. The comparisons I want are: HA_infected vs. HA_uninfected, CA_infected vs. CA_uninfected, and HA_infected vs. CA_infected. Right now, my DESeq2 design is design =~ breed + status + breed:status
. First of all, is this correct?
Also, how do I then do the contrasts? I tried res_HA_PBS_vs_Infected <- as.data.frame(results(ddsMat, contrast=c("status", "PBS", "Infected")))
for the first comparison, but I'm not sure this is correct. Any suggestions would be appreciated!
Thank you!
The Interactions section of the DESeq2 tutorial goes over this, I find this much simpler than using an interaction term and then trying to remember how to fetch results corresponding to different contrasts.
Does this mean just adding a new meta data column in which I have added the comparisons I want? For example, a combination of breed and condition so we have HA_infected, HA_uninfected, CA_infected, and CA_uninfected in the same place ?
Exactly. And you can convert this new variable to
factor
and set the levels if you like.I tried changing the factors to include only the comparison I wanted, but it led to NA values. And when I left all of the factors within the design:
which notably does not include all of the comparisons, such as "HA_infected_vs_HA_PBS".
Doesn't matter, you can have the code do any reasonable comparison you want it to,
resultsNames
is not a complete set of all possible comparisons among the factor levels.Why use
breed:status
? Why not simplybreed + status
?@Ram, the design formula above would not enable differentiating between the effect of infection in different breeds for example but just give an "overall" effect of infection irrespective of different breeds.