Problem in identifying model matrix
1
0
Entering edit mode
9.8 years ago
Naim.Mahi ▴ 40

Hi all,

I am working on a RNA-Seq data where my factor set looks like the following:

Type       Patient            Time
C             3                T0
C             3                T1
C             8                T0
C             8                T1
C             9                T0
C             9                T1
C            10                T0
C            10                T1
C             5                T1
C            11                T1
A            1                 T0
A            1                 T1
A            4                 T0
A            4                 T1
A            6                 T0
A            6                 T1
A            7                 T0
A            2                 T1

Here, I want to see the change in expression at time T1 between C and A.

I tried to specify the model matrix in edgeR as:

design <- model.matrix(~Type+patient+Type:Time)

But, when I tried to use "estimateGLMCommonDisp" command, it shows an error saying that the design is not of full rank.

Could anyone please help me by correcting my model matrix?

Thanks in advance!

RNA-Seq R software error edgeR ModelMatrix • 11k views
ADD COMMENT
1
Entering edit mode

Hint: Type is a linear combination of patient, which is causing the error.

ADD REPLY
0
Entering edit mode

Patient is nested within Type. I want to consider Patient as a block effect while testing for change at time T1 between C and A. Just can't reach the exact idea here!

ADD REPLY
0
Entering edit mode

Is the lowercase patient here a typo?

design <- model.matrix(~Type+patient+Type:Time)

It appears in uppercase in the matrix

ADD REPLY
0
Entering edit mode

Nope. It's all good in the case. It is actually patient, I wrote here with upper-case! Problem is in specifying the model matrix.

ADD REPLY
0
Entering edit mode
9.8 years ago

What I was trying to get at with my hint is that if you include patient you then have no use for Type (the Type effect is completely determined by the patient effect). So ~patient+Type:Time.

BTW, you'll probably need to get rid of some patients too. There are 4 (2, 5, 7, and 11) that are uninformative.

ADD COMMENT
0
Entering edit mode

It's still showing the same problem, even after getting rid of these patients !!

Error in glmFit.default(y, design = design, dispersion = dispersion, offset = offset,  :
  Design matrix not of full rank.  The following coefficients not estimable:
 TypeA:TimeT1 TypeC:TimeT1

This is the error I'm getting.

ADD REPLY
0
Entering edit mode

If you keep time as a factor, then you're asking the model to fit a coefficient for the each of the 4 Type:Time combinations. Consequently, you have things like TypeA:T0 and TypeA:T1, which are the sum of patients in the TypeA group. If you instead use Type as a numeric, then you'll find that it works (and it should answer the question you want).

ADD REPLY

Login before adding your answer.

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