Question: DESeq2 design for paired samples 'Model matrix not full rank'
0
4 weeks ago by
rrdavis0
rrdavis0 wrote:

Hi,

I have a set of RNA-seq data where each mouse has a treated side and a control side. My main goal is to compare treatment groups vs their matched controlled side while taking into account the effects of the mouse. I would also like to look at the differences between treated groups as well.

Here is my sample list:

samples2
sample_id condition mouse
1  4362L_RES_T     RES_T  4362
2  4362R_RES_C     RES_C  4362
3  4363L_RES_T     RES_T  4363
4  4363R_RES_C     RES_C  4363
5  4364L_RES_C     RES_C  4364
6  4364R_RES_T     RES_T  4364
7  4365L_RES_C     RES_C  4365
8  4365R_RES_T     RES_T  4365
9  4366L_CPG_C     CPG_C  4366
10 4366R_CPG_T     CPG_T  4366
11 4368L_CPG_C     CPG_C  4368
12 4368R_CPG_T     CPG_T  4368
13 4371L_CPG_C     CPG_C  4371
14 4371R_CPG_T     CPG_T  4371
15 4372L_CPG_C     CPG_C  4372
16 4372R_CPG_T     CPG_T  4372


Here is my design:

ddsTxi2 <- DESeqDataSetFromTximport(txi2, colData = samples2, design = ~mouse + condition)


I get 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.

vignette('DESeq2')


I've read through the vignette and the section mentioned above but fail to apply it to my example. I am interested in REST vs RESC and also REST vs CPGT (and the other possible permutations of comparisons). what should be my design?

Thanks!

deseq2 • 77 views
modified 4 weeks ago by Michael Love25k • written 4 weeks ago by rrdavis0
Answer: DESeq2 design for paired samples 'Model matrix not full rank'
0
4 weeks ago by
Michael Love25k
United States
Michael Love25k wrote:

Your mice are nested within the groups {res, cpg}

This is addressed in the vignette section. Take another look.

Should I break my condition column into two columns? One that has RES or CGP and the other column that has T(treatment) and C(control). Then this looks exactly like the example in the vignette and adding another column to distinguish the mice seems easy.

If I leave my condition column as is, then I don't know how to work around the fact that my mice are nested in my conditions.

Here is a new coldata:

> samples2
sample_id group mouse treatment condition mouse.t
1  4362L_RES_T RES_T  4362       RES         T       1
2  4362R_RES_C RES_C  4362       RES         C       1
3  4363L_RES_T RES_T  4363       RES         T       2
4  4363R_RES_C RES_C  4363       RES         C       2
5  4364L_RES_C RES_C  4364       RES         C       3
6  4364R_RES_T RES_T  4364       RES         T       3
7  4365L_RES_C RES_C  4365       RES         C       4
8  4365R_RES_T RES_T  4365       RES         T       4
9  4366L_CPG_C CPG_C  4366       CPG         C       1
10 4366R_CPG_T CPG_T  4366       CPG         T       1
11 4368L_CPG_C CPG_C  4368       CPG         C       2
12 4368R_CPG_T CPG_T  4368       CPG         T       2
13 4371L_CPG_C CPG_C  4371       CPG         C       3
14 4371R_CPG_T CPG_T  4371       CPG         T       3
15 4372L_CPG_C CPG_C  4372       CPG         C       4
16 4372R_CPG_T CPG_T  4372       CPG         T       4


Would this new design be what I am looking for:

ddsTxi2 <- DESeqDataSetFromTximport(txi2, colData = samples2, design = ~treatment + treatment:mouse.t + treatment:condition)


Try to set it up just like the vignette example. If you have further questions about how the model works you may want to collaborate with a statistician or person familiar with linear modeling.

Thanks Michael!

I edited my reply with a new model which I believe is good but would love your input.

I’m here to provide software support, but must limit myself to that. If you really want to make sure your design is correct, and aren’t sure what’s going on with the terms in the model after reading the documentation, you need to consult with a statistician.

totally understand. I appreciate the help and have contacted a statistician!

Content
Help
Access

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