Design Formula With DESeq2
1
0
Entering edit mode
5.4 years ago

Hi,

I'm new to contrast / design functions with DESeq2. I have some RNAseq datas from MS patients. Here is an exemple of my sample table:

NAME    STATUS  CELLTYPE    COMPCHLES
S1.A    MS  CD4mem  LESLOW
S1.B    MS  CD4naiv LESLOW
S1.C    MS  CD8mem  LESLOW
S1.D    MS  CD8naiv LESLOW
S2.A    HV  CD4mem  HV
S2.B    HV  CD4naiv HV
S2.C    HV  CD8mem  HV
S2.D    HV  CD8naiv HV
S3.A    MS  CD4mem  LESHIGH
S3.B    MS  CD4naiv LESHIGH
S3.C    MS  CD8mem  LESHIGH
S3.D    MS  CD8naiv LESHIGH
S4.A    HV  CD4mem  HV
S4.B    HV  CD4naiv HV
S4.C    HV  CD8mem  HV
S4.D    HV  CD8naiv HV

I want to compare COMPCHLES (number of brain lesions) between my patients, depending on CELLTYPE and the disease STATUS. I tried something like this :

dds <- DESeqDataSetFromMatrix(countData = exprDat, colData = sampleAnnot, design = ~CELLTYPE + STATUS + COMPCHLES)

But its not working, and I dont realy get the following message:

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.

If I can have some clues about this warning and some help to solve my problem, it would be nice.

Thanks, Hadrien

RNA-Seq • 3.1k views
ADD COMMENT
2
Entering edit mode

Search for the model matrix is not full rank, you will find lots of posts discussing the issue and how to solve it. This one may be useful to you:

With DESeq2 "Not full rank" Error with design ~ line + time + condition

ADD REPLY
1
Entering edit mode

The rank of a model matrix, loosely speaking, is the maximum number of linearly independent columns to define the model. The info in your STATUS column is contained in the COMPCHLES column, as also told by swbarnes2 in the answer section. That is why, the model.matrix is not full rank and you need to drop at least one of them from the design formula.

ADD REPLY
1
Entering edit mode

BTW, this thread will definitely help you if you are new to the design formula: How is the design in DESeq2 work?

Esp., check this reply from Michael Love (Developer of DESeq2) C: How is the design in DESeq2 work?

ADD REPLY
0
Entering edit mode

Thx for your anwsers and explainations, i'll check this quickly!

ADD REPLY
1
Entering edit mode

Well, Maybe I have an interpreting Question now.

In this case, using this formula :

dds <- DESeqDataSetFromMatrix(countData = exprDat,
                              colData = sampleAnnot,
                              design = ~CELLTYPE + COMPCHLES)
dds <- DESeq(dds)

And check results with:

res<-results(dds,contrast=c("COMPCHLES","LESHIGH","LESLOW"))

means check DE genes between "LESHIGH" and "LESLOW", not depending on the cellular type?

ADD REPLY
1
Entering edit mode

yes, that's the right interpretation

ADD REPLY
0
Entering edit mode

Alright, thanks you.

Can I push a bit more? what should I type in design / contrast if I want to check DE depending on COMPCHLES, but in each cellular type? Maybe should I change my design?

ADD REPLY
0
Entering edit mode

since you are interested in the effect of the combination of CELLTYPE and COMPCHLES, you may create a new grouping as follows

newGroup = paste0(CELLTYPE, "_", COMPCHLES)

Then use only newGroup in your design formula. It's level will contain all the combinations of CELLTYPE & COMPCHLES. Then by using the contrast as before, you may pull the right contrast to compare.

ADD REPLY
0
Entering edit mode

Thanks a lot! Now its time to work:)

ADD REPLY
2
Entering edit mode
5.4 years ago

Drop status from your design. The last column contains the same info, but more detailed.

That error means that you are asking the software to separate the effects of status and lesions, but that can't be done. See how all the HV status samples are also all the HV comp samples? The software sees that as hopelessly confounded. If this was a batch effect, there'd be no solution, but in your case, since the two columns mean much the same thing, you need to use only one.

ADD COMMENT
0
Entering edit mode

Thanks, good to know, its working perfectly now!

ADD REPLY

Login before adding your answer.

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