Hello,
I run DESeq2 with multilevel. For each of the levels, I run "results" with the desired contrast between pairs of conditions. When I run resultsNames, I noticed that output refers to the first level as background. Also, lfcShrink shows different condition for "log2 fold change (MAP)" and "Wald test p-value". Here is a snapshot of what is happening but I am willing to share more offline.
> dds$condition <- factor(dds$condition, levels = c("K_DMSO", "K_I50", "K_I500", "K_I5000", "M_DMSO", "M_I50", "M_I500", "M_I5000")) > dds <- DESeq(dds) > resM_5000vsM_DMSO <- results(dds, contrast = c("condition","M_I5000", "M_DMSO")) > resultsNames(dds) [1] "Intercept" "condition_K_I50_vs_K_DMSO" "condition_K_I500_vs_K_DMSO" "condition_K_I5000_vs_K_DMSO" "condition_M_DMSO_vs_K_DMSO" "condition_M_I50_vs_K_DMSO" "condition_M_I500_vs_K_DMSO" "condition_M_I5000_vs_K_DMSO" > resM_5000vsM_DMSOLFC <- lfcShrink(dds = dds, coef = 2, res = resM_5000vsM_DMSO) > resM_5000vsM_DMSOLFC_contrast <- lfcShrink(dds = dds, contrast = c("condition","M_I5000", "M_DMSO"), res = resM_5000vsM_DMSO)
for resM_5000vsM_DMSO, I have "log2 fold change (MLE): condition M_I5000 vs M_DMSO"
for resM_5000vsM_DMSOLFC, I have "log2 fold change (MAP): condition K I50 vs K DMSO" ?(Although run on resM_5000vsM_DMSO)
for resM_5000vsM_DMSOLFC_contrast, I have "log2 fold change (MAP): condition M_I5000 vs M_DMSO"
I have two questions:
1) why is resultsNames returning conditions where always one reference is considered (K_DMSO)?
2) why lfcShrink behaves differently with coef than with contrast, and which one should be used assuming I need to get the shrunken LFC for each condition
Many thanks and any help is appreciated.
Oops, I missed this post because it didn't have the tag 'deseq2'. I'm fixing that now and will answer.