DESeq2 "Not full rank" and "Less than full rank" Errors with design ~ time + ind.nested + time:ind.nested
1
0
Entering edit mode
Erika • 0
@4422eafe
Last seen 8 months ago
Germany

Hello Michael,

I'm really grateful that you posted the reply 8.5 years ago in With DESeq2 "Not full rank" Error with design ~ line + time + condition. I tried your 2 approaches with the current version of DESeq2 (v1.38.3) that I have installed, and each time I get the following error message, respectively: 1) "Error in checkFullRank(modelMatrix) : 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."

2) " Error in designAndArgChecker(object, betaPrior) : full model matrix is less than full rank "

My design is slightly simpler than Cor's because I have no treatment. Therefore, I have a time series with multiple individuals sampled at each time point, with some time points missing from certain individuals. The design I was trying get working is:

  ~ time + ind.nested + time:ind.nested

I hope that I got the design right...
I am assuming that each individual has a slightly different reaction over time so I added the interaction. I made sure to have time=0 for all individuals so that I can set that as intercept.
The simpler model without the interaction ( ~ time + ind.nested) works when I run DESeqDataSetFromMatrix() and DESeq(), so I'm assuming that it's the missing time points in some of the individuals that's causing the problem. I saw in in your github code that the lack of full rank error message is generated when qr(mm)$rank < ncol(mm), and I have the values 31 < 36 when I ran the 2 commands manually in R. (Sorry, I'm a bit lost about what this qr$rank is telling me.)

Here is part of the colData:

Sample   ind.nested   time
1   A   0
2   A   1
3   A   2
4   A   3
5   A   4
6   B   0
7   B   1
8   B   2
9   B   3
10   B   4
11   C   0
12   C   2
13   C   3
14   C   4
15   D   0
16   D   1
17   D   3
18   D   4
etc.

This is what I did:
1) dds <- DESeqDataSetFromMatrix(countData = zCount, colData = z, design = ~1)
mm <- model.matrix(~ time + ind.nested + time:ind.nested, data=z)
mm <- as.data.frame(mm)[, colSums(mm) != 0] # remove columns with only zeros
design(dds) <- ~ time + ind.nested. + time:ind.nested
dds <- DESeq(dds, full=mm, betaPrior=FALSE)

I also tried:
2) design(dds) <- ~ time + ind.nested + time1ind.nestedA + time2ind.nestedA + ...
dds <- DESeq(dds)

I tried to add as many details about the issue I'm encountering as I could in hopes that you could help me. I am at a loss about what to do to solve the problem, so I'm very grateful for your help.

Thank you very much for your time.

Erika

DESeq2 • 579 views
ADD COMMENT
1
Entering edit mode
@mikelove
Last seen 22 hours ago
United States

You can't estimate individual-specific time effects unless you have replication (multiple samples for each individual at the same time point).

I have a time series with multiple individuals sampled at each time point, with some time points missing from certain individuals

From what I'm reading, you have different samples and want to understand the time effect across these donors? Why not use simply ~donor + time?

That is

design(dds) <- ~donor + time
dds <- DESeq(dds)
results(dds)
ADD COMMENT
0
Entering edit mode

Hello Michael,

Thank you very much for your response back.
We wanted to take into account the individual-related stochasticity when measuring response over time but you are right in that we only have one sample per individual at each time point.

So, for future reference, do you mean that we can use a design such as:
~ time + individual + time:individual
only if we have the following type of data set, right?
Sample   individual   time
1   A   0
2   A   0
3   A   1
4   A   1
5   B   0
6   B   0
7   B   1
8   B   1
etc.

Erika

ADD REPLY
1
Entering edit mode

Yes you need replication to have individual specific effects.

ADD REPLY
0
Entering edit mode

Hello Michael,

Great! Now I understand. :-) Thank you very much for guiding me through and your advice! I'm really grateful for your help!

ADD REPLY

Login before adding your answer.

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