Group-specific condition effects with individuals nested: matrix is not full rank
1
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 • 498 views
ADD COMMENT
0
Entering edit mode

What happens if you remove the columns of all zeros?

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 think I found the issue: my design matrix has some combination that doesn't exist:

1) Is it the right thing to do ?

all.zero <- apply(design, 2, function(x) all(x==0))
all.zero

idx <- which(all.zero)
design <- design[,-idx]

dds <- DESeqDataSetFromMatrix(data, colData = meta, design = design)
dds <- DESeq(dds)

2) If I want KO vs WT in Group X while correcting for Donor effect, is GroupX.ConditionKO the right coefficient ?

ADD REPLY
2
Entering edit mode
@james-w-macdonald-5106
Last seen 3 hours ago
United States

Yes to both questions.

0
Entering edit mode

Thanks, I have a doubt about something:

If GroupX.ConditionKO is KO vs WT in group X, does it mean:

1) GroupY.ConditionKO is KO vs WT in group Y

2) or should it be GroupX.ConditionKO + GroupY.ConditionKO is KO vs WT in group Y

ADD REPLY

Login before adding your answer.

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