Interaction term - Model matrix not full rank
Entering edit mode
Last seen 22 months ago
United States

Hi All:

I have a question about interaction design. I have the following design:

<caption>Experimental design file</caption>
SampleName group day
Sample1 Ctrl 0
Sample2 Ctrl 0
Sample3 Ctrl 0
Sample4 CellLine 4
Sample5 CellLine 4
Sample6 CellLine 4
Sample7 CellLine 8
Sample8 CellLine 8
Sample9 CellLine 8
Sample10 CellLine 8
Sample11 CellLine 12
Sample12 CellLine 12
Sample13 CellLine 12
Sample14 CellLine 12

Ctrl group is constant for all the 3 time-points of my CellLine. I have successfully identified the DEGs among the pariwise comparisons using the following design with contrast

ds <- DESeqDataSetFromMatrix(countData=counts, colData=samples, design=~grp_day)#combining group_day as one factor


res.model1 <- results(ds, contrast=c("grp_day", "CellLine4", "Ctrl0")) 

res.model1 <- results(ds, contrast=c("grp_day", "CellLine8", "Ctrl0")) 

res.model1 <- results(ds, contrast=c("grp_day", "CellLine12", "Ctrl0")) 

I am also interested to identify the genes that are changing over the time in CellLine group compared to Ctrl group. I therefore used the interaction term design, as follows:

ds <- DESeqDataSetFromMatrix(countData=counts, colData=samples, design=~group+day+group:day)

But at this line I am getting the following error:

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':  vignette('DESeq2')


I'd like to detect all the genes changes over the time (4, 8 and 12 days) when comparing with Ctrl(0 day). 

What's wrong with my interaction design? How can I fix this error?

Please suggest what would be the best design to identify all the genes changes over the time (4, 8, 12 days) with respect to Ctrl group (0 day).

I'd appreciate any help on the aforementioned design and look forward to learning your advice to improve my design to achieve the desired output.

Thank You,


deseq2 interaction term • 3.2k views
Entering edit mode
Last seen 1 day ago
United States

hi Sofia,

Group = Ctrl and day = 0 are the same samples here. So you can only use a design of ~day. This design contains the information in group, and so you cannot add both variables to the design. 

To identify changes over time (change at any time point), you can use a LRT of ~day compared to ~1:

dds <- DESeq(dds, test="LRT", reduced=~1)
res <- results(dds)

Please see the LRT section of the vignette, and the section of ?results which discusses likelihood ratio tests.

Entering edit mode

Hello Michael:

Thank you for your suggestions. 

Many thanks, Sofia


Login before adding your answer.

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