Hi,
I have a question on how to define contrast when the design includes 2 level factors and an interaction term. design =~genome+condition+condition:genome.
The resultsNames(dds):
"Intercept" "genome_yb1_vs_v252" "condition_mice_vs_log" "genomeyb1.conditionmice"
I need the following comparison:
1. mice vs log in all the samples
2. mice vs log only in v252 samples
3. mice vs log only in yb1 samples
The way I defined the contrast for each comparison:
1. contrast = c("condition","mice","log")
2. contrast = list("condition_mice_vs_log")
3. contrast = list(c("condition_mice_vs_log","genomeyb1.conditionmice"))
I get the same results for the first 2 comparisons. To which of the comparisons is the contrast correct and how to define the contrast to the other comparison.
Thank you,
Karen
hi Karen,
The non zero LFC here is because models with an interaction term include shrinkage on the interaction term but not on main effects. The inference is borrowing strength from the other group and from the other genes. The interaction effects were found to be small over all genes, and the condition effect was found to be large for this gene in the other group, so the model is essentially predicting that if the counts for yb1 rise above zero, a negative LFC would be likely. But to avoid such situations, you can either run a model with a single factor "~ group" where group encodes, for example "mice_yb1", etc.; or you can set betaPrior=FALSE to turn off the shrinkage of interaction terms. Then the LFCs as in your contrast will be closer to zero.