Question: DESeq2 - lfcShrink with list contrast on grouped variable
0
3 months ago by
gcagle10
gcagle10 wrote:

Dear DESeq2 support: I wish to use lfcShrink after doing a contrast with a 2X2 factor experiment. I grouped the variables based on the suggestion in ?results because I am interested in specific interactions as well as main effects. I could not find how to proceed with lfcShrink for results object generated with results(contrast=list() which I used to test the main effects.

Here is an example where I would like to know the effect of "fertilizer":

dds <- makeExampleDESeqDataSet()
dds$fertilizer <- factor(rep(c("fertilized", "unfertilized"),each=1)) colData(dds)$group <- factor(paste0(colData(dds)$condition, "_", colData(dds)$fertilizer))
design(dds) <- ~ group
dds <- DESeq(dds)
resultsNames(dds)

# test fertilizer effect
res_fertilizer <- results(dds, contrast=list(c("group_B_fertilized_vs_A_fertilized","Intercept"), c("group_A_unfertilized_vs_A_fertilized","group_B_unfertilized_vs_A_fertilized")), listValues=c(1/2, -1/2))

# shrink
res_shrink <- lfcShrink(dds, res = res_fertilizer, contrast = list(c("groupA_fertilized","groupB_fertilized"), c("groupA_unfertilized","groupB_unfertilized")), type = "normal")


1) Does this give me the shrunk lfc between fertilized and unfertilized averaged over condition? 2) Would it be better to scrap this and use two designs: one "full" design for main effects, and one "grouped" for interactions? I started using this "group" method based on the ?results help and other message board questions but I couldn't get a sense of if it could/should be used for main effects as well as the interactions.

Thank you!!

deseq2 • 144 views
modified 3 months ago by Michael Love22k • written 3 months ago by gcagle10
Answer: DESeq2 - lfcShrink with list contrast on grouped variable
1
3 months ago by
Michael Love22k
United States
Michael Love22k wrote:

If the coefficients are difficult to interpret, you might be better off running ~group for the main effects and the interaction model to test the interaction term. There's nothing wrong with that.

lfcShrink doesn't have listValues, because users don't often want to average effects. But you could multiply what you have by 1/2 to get the shrunken average effect.