DESeq2 one group vs multigroup comparison error
1
0
Entering edit mode
v.t • 0
@vt-15320
Last seen 6.0 years ago

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.

 

deseq2 • 1.2k views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 1 day ago
United States

The positions in the contrast refer to the coefficients in resultsNames(dds). Have you taken a look at that?

ADD COMMENT
0
Entering edit mode

Hi Michael,

Yes, it has 17 elements, first one being the "Intercept". Other 16 are all comparisons against one group.

ADD REPLY
1
Entering edit mode

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, ...

ADD REPLY
0
Entering edit mode

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,

DESeq2 verison 1.18

resultNames(dds)

 [1] "Intercept"                       "SUBGROUP_G2_vs_G1"   "SUBGROUP_G3_vs_G1"   "SUBGROUP_G4_vs_G1"

And

DEseq2 version 1.14

resultsNames(dds)

 [1] "Intercept"          "SUBGROUPG1"   "SUBGROUPG2"   
[4] "SUBGROUPG3

This is the main issue I've been facing.

 

ADD REPLY
1
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

Ah! Missed it. But how would one deal with this kind of multiple comparison when coefficients are comparisons mode?

ADD REPLY
0
Entering edit mode

That's why I recommend to use ~0 + condition. I don't follow the question.

ADD REPLY
0
Entering edit mode

Thanks a lot. I will follow the suggestion.

ADD REPLY

Login before adding your answer.

Traffic: 634 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6