Group-specific condition effects with individuals nested: matrix is not full rank
0
0
Entering edit mode
picasa1983 • 0
@picasa1983-14806
Last seen 2 hours ago
USA

Hi, I have(almost) a similar data than:

https://bioconductor.org/packages/3.21/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#group-specific-condition-effects-individuals-nested-within-groups

| Group  | Donor | Condition | Age | Donor_nested |
|--------|-------|-----------|-----|--------------|
| X      | 1     | KO        | 60  | 1            |
| X      | 1     | WT        | 60  | 1            |
| X      | 2     | KO        | 50  | 2            |
| X      | 2     | WT        | 50  | 2            |
| Y      | 3     | KO        | 65  | 1            |
| Y      | 3     | WT        | 65  | 1            |
| Y      | 4     | KO        | 55  | 2            |
| Y      | 4     | WT        | 55  | 2            |
| Y      | 5     | KO        | 45  | 3            |
| Y      | 5     | WT        | 45  | 3            |

My goal is to find DEGs KO vs WT for each Group separately, and accounting for batch effect.

However, as you can see I have more donors in my Y group than my X group.

I tried to create a dds object:

dds <- DESeqDataSetFromMatrix(data, colData = meta, design = ~ Group + Group:Donor_nested + Group:Condition)

But got this error:

the model matrix is not full rank, so the model cannot be fit as specified. Levels or combinations of levels without any samples have resulted in column(s) of zeros in the model matrix.

Do you have any solution ? Thanks

DESeq2 • 119 views
ADD COMMENT
0
Entering edit mode

What happens if you remove the columns of all zeros?

ADD REPLY
0
Entering edit mode

The problem is that donor 4 is nested with condition since it is KO for both the donor 4 samples. Removing that and then making a new donor_nested column should solve it.

ADD REPLY
0
Entering edit mode

sorry I made a typo in my table (now edited). The donor 4 actually has the 2 conditions: KO and WT.

I tried something, could it be the reason of the error ?

I first convert all columns to factor exept Age:

meta <- meta %>%
  mutate(across(-Age, as.factor)) 

 str(meta) 

'data.frame':   x obs. of  y variables:
 $ Group        : Factor w/ 
 $ Donor       : Factor w/ 
 $ Condition             : Factor w/ 
 $ Age             : int  ...
 $ Donor_nested    : Factor w/ 
ADD REPLY

Login before adding your answer.

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