Error in checkFullRank(modelMatrix) : the model matrix is not full rank, so the model cannot be fit as specified.
1
0
Entering edit mode
13 days ago
mropri ▴ 150

I am trying to create a dds object using the formula below:

 dds <- DESeqDataSetFromMatrix(counts, 
                                colData = md, 
                                design = ~PCNAscore + IEGscore + group)

But I keep getting this error:

converting counts to integer mode
Error in checkFullRank(modelMatrix) : 
  the model matrix is not full rank, so the model cannot be fit as specified.
  One or more variables or interaction terms in the design formula are linear
  combinations of the others and must be removed. Please read the vignette section 'Model matrix not full rank':

I have read the vignette and understand that if batch and condition are confounded then it is not possible to create a model based on that. However, my variables of interest in the model do not seem confounded. I have uploaded an image of my md where I have the columns group, PCNAscore and IEGscore that I am using in the design matrix. I am confused why I am getting this error. Any help would be appreciated.

enter image description here

DESeq2 • 359 views
ADD COMMENT
0
Entering edit mode

Hi, I just wanted to update that IEGscore and PCNAscore were linearly dependent (or linear combinations of each other). I tested this using linear regression and the two variables have an r squared value of 1 thus indicating they are perfect linear combinations of each other. however, now I am using this design model

dds <- DESeqDataSetFromMatrix(counts, colData = md, design = ~PCNAscore + group)

and it is still giving me the same error. I checked if group and PCNA are linearly dependent using a linear regression model and the r squared value is 0.2. So i should expect the design to work, Any help is appreciated.

ADD REPLY
0
Entering edit mode
12 days ago

Any chance the numerical columns were imported as factors?

ADD COMMENT
0
Entering edit mode

Hi swbarnes2, that was the problem, they were not numeric but as character columns. converted them and it fixed the error. Thank you for your help.

ADD REPLY

Login before adding your answer.

Traffic: 1231 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