Hi everyone -
I'm running a Differential Expression analysis via DESeq2 (DESeq2_1.16.1) .
I have three levels in the conditions (SNP_A, SNP_B, and control), and I set as reference the "control" level. Each condition has three biological replicates. Then I ran this:
dds <- DESeqDataSet(se, design = ~ condition) dds <- DESeq(dds)
From the dds obtained above, I ran pairwise comparison between conditions as following:
ACres <- results(dds, contrast=c("condition", "SNP_A", "control")) BCres <- results(dds, contrast=c("condition", "SNP_B", "control")) BAres <- results(dds, contrast=c("condition", "SNP_B", "SNP_A"))
So far, all work well. However, when I try to run the lfcShrink function for the same contrast, only work for the first two (the ones comparing each SNP with the control), but not for the contrasts between SNPs. Here the code I used:
ACres.lfc <- lfcShrink(dds, contrast=c("condition", "SNP_A", "control"), res = ACres) BCres.lfc <- lfcShrink(dds, contrast=c("condition", "SNP_B", "control"), res = BCres) BAres.lfc <- lfcShrink(dds, contrast=c("condition", "SNP_B", "SNP_A"), res = BAres)
I got the following error:
Error in cleanContrast(object, contrast, expanded = isExpanded, listValues = listValues, : conditionSNP_B and conditionSNP_A are expected to be in resultsNames(object)
When I check the resultsNames(dds) I got only
[1] "Intercept" "condition_SNP_A_vs_control" "condition_SNP_B_vs_control"
I don't understand why I can not get all possible contrasts when using the lfcShrink function as when using only the results function. How can I run this other contrast? Should I set another level as a reference and redoing all again?
Many thanks in advance in this matter.
Hi Michael -
I used "dots" instead underscores and it works. Thank you very much indeed.
hi Oskar,
If you have a chance, can you try my example below? I'm confused as to why I don't see the same error. (And would like to fix the bug if it exists for underscores in factor levels and lfcShrink usage). Was everything run with DESeq2 v1.16.1 from Bioconductor?