Hello fellow DESeq2 users,
Using the example given in the vignette regarding interaction terms, I am unable to output a results table where the log2 fold changes are shrunken using lfcShrink(). I tried using the 'contrast' and 'coef' arguments but have had luck with neither. I also tried using 'coef=8', as this is the number of coefficients in resultsNames(dds)
colData <- as.data.frame(cbind(condition, genotype))
rownames(colData) <- colnames(countData)
dds <- DESeqDataSetFromMatrix(countData = countData, colData = colData, design = ~ genotype + condition + genotype:condition)
dds <- DESeq(dds, fitType='local')
 "Intercept" "genotype_II_vs_I" "genotype_III_vs_I"
 "condition_B_vs_A" "genotypeII.conditionB" "genotypeIII.conditionB"
res <- results(dds, contrast = c("genotype", "II", "I" )) #equivalent to res <- results(dds, name="genotype_II_vs_I" )
resLFC <- lfcShrink(dds, contrast = c("genotype", "II", "I" ), res=res)
Error in averagePriorsOverLevels(objectNZ, betaPriorVar) :
beta prior for genotypeI.conditionA,genotypeII.conditionA,genotypeIII.conditionA,genotypeI.conditionB is not greater than 0
resLFC <- lfcShrink(dds, coef=2, res=res)
Error in designAndArgChecker(object, betaPrior) :
betaPrior=FALSE should be used for designs with interactions
I know by default the betaprior=FALSE, so I am not sure about the second error. How can I get the shrunken LFC as I do when making pairwise comparisons?