DESeq2: model matrix is not full rank
Entering edit mode
sagharib • 0
Last seen 17 days ago
United States

I am running DESeq2 for paired analysis of subjects under different conditions, but get

Error in checkFullRank(modelMatrix) : the model matrix is not full rank

when I run

dds <- DESeqDataSetFromMatrix(countData = cts, colData = coldata, design = ~ Subject + Condition)

My colData is below:

                 Subject    Condition

170.HF.HP_S33   subject170  CHD.HF.HP

172.HF.HP_S10   subject172  CHD.HF.HP

92.HF.HP_S38    subject92   CHD.HF.HP

170.HF.LP_S32   subject170  CHD.HF.LP

172.HF.LP_S45   subject172  CHD.HF.LP

92.HF.LP_S37    subject92   CHD.HF.LP

170.LF.HP_S31   subject170  CHD.LF.HP

172.LF.HP_S11   subject172  CHD.LF.HP

92.LF.HP_S36    subject92   CHD.LF.HP

170.LF.LP_S30   subject170  CHD.LF.LP

172.LF.LP_S12   subject172  CHD.LF.LP

92.LF.LP_S35    subject92   CHD.LF.LP

170.Static_S29  subject170  CHD.Static

172.Static_S13  subject172  CHD.Static

92.Static_S34   subject92   CHD.Static

107.HF.HP_S5    subject107  FD.HF.HP

112.HF.HP_S43   subject112  FD.HF.HP

116.HF.HP_S18   subject116  FD.HF.HP

107.HF.LP_S7    subject107  FD.HF.LP

112.HF.LP_S42   subject112  FD.HF.LP

116.HF.LP_S17   subject116  FD.HF.LP

107.LF.HP_S6    subject107  FD.LF.HP

112.LF.HP_S41   subject112  FD.LF.HP

116.LF.HP_S16   subject116  FD.LF.HP

107.LF.LP_S8    subject107  FD.LF.LP

112.LF.LP_S40   subject112  FD.LF.LP

116.LF.LP_S15   subject116  FD.LF.LP

107.Static_S9   subject107  FD.Static

112.Static_S39  subject112  FD.Static

116.Static_S14  subject116  FD.Static

105.HF.HP_S28   subject105  IPAH.HF.HP

168.HF.HP_S23   subject168  IPAH.HF.HP

95.HF.HP_S1     subject95   IPAH.HF.HP

105.HF.LP_S27   subject105  IPAH.HF.LP

168.HF.LP_S22   subject168  IPAH.HF.LP

95.HF.LP_S44    subject95   IPAH.HF.LP

105.LF.HP_S26   subject105  IPAH.LF.HP

168.LF.HP_S21   subject168  IPAH.LF.HP

95.LF.HP_S2     subject95   IPAH.LF.HP

105.LF.LP_S25   subject105  IPAH.LF.LP

168.LF.LP_S20   subject168  IPAH.LF.LP

95.LF.LP_S3     subject95   IPAH.LF.LP

105.Static_S24  subject105  IPAH.Static

168.Static_S19  subject168  IPAH.Static

95.Static_S4    subject95   IPAH.Static

I would like to perform paired comparison for subjects between two given conditions, so for example, subjects 170, 172, 92 in condition CHD.HF.HP vs. condition CHD.HF.LP. When I limit the colData to just the above example (three subjects compared between two conditions), I don't get an error, but when expanding it to all conditions and samples as reflected in the full colData, I get the model matrix error.

sessionInfo() R version 4.1.1 (2021-08-10) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Big Sur 11.6

Thanks for your help!

DESeq2 • 175 views
Entering edit mode
Last seen 29 minutes ago
United States

We have a section of the vignette on how to setup designs with individuals are nested within groups.

Beyond reading that, I'd recommend for setting up an appropriate design to consult with a local statistician or someone familiar with linear models in R.

Entering edit mode

I had a hard time following the vignette for nested conditions. Would it be OK to just run DESeq2 multiple times for specific comparisons, or is it always recommended to build the dds model using all available data first, then apply specific comparisons? Thx.

Entering edit mode

You can run it on subset of data, that's fine (see FAQ on this in vignette).


Login before adding your answer.

Traffic: 235 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6