Hello,
I'm trying to perform one group vs multi group comparison with DESeq2. I have 17 groups. What I'm doing typically is following (suggestions followed from this post: DESeq2: one condition vs multiple combined)
dds dds=DESeq2(dds) # For group1 group1 = results(dds, contrast = c(0, 1, -1/16, -1/16, -1/16, -1/16, -1/16, -1/16, -1/16, -1/16, -1/16, -1/16, -1/16, -1/16, -1/16, -1/16, -1/16, -1/16)) Error in checkContrast(contrast, resNames) : numeric contrast vector should have one element for every element of 'resultsNames(object)'
When I remove one `-1/16`, it seems to be working, but this way I will miss on one group's information at one point. `coldata` contains 17 groups in `condition` column.
I know I must've committed a mistake somewhere, but I'm not able to track it down. Any help would be greatly appreciated.
Thank you.
Hi Michael,
Yes, it has 17 elements, first one being the "Intercept". Other 16 are all comparisons against one group.
Your vector above has 18 elements, so then the error makes sense.
You can try a design of ~0 + condition, so that there is no intercept, and then use a contrast of e.g. c(1, -1/16, ...
Hi Michael,
I think I figured out the error. `resultsNames(dds)` output is different for DESeq2 version 1.14 & 1.18. Currently, I'm using later version. I've checked the package version history it was not addressed. (Exact script worked fine with version 1.14)
For example,
And
This is the main issue I've been facing.
Yes, In version 1.16 the default of betaPrior was changed to FALSE. This is discussed in NEWS and in the vignette section about changes since the publication.
Ah! Missed it. But how would one deal with this kind of multiple comparison when coefficients are comparisons mode?
That's why I recommend to use ~0 + condition. I don't follow the question.
Thanks a lot. I will follow the suggestion.