Deseq2 Error in solve.default(qr.R(qrx)) : 'a' (1 x 0) must be square
1
0
Entering edit mode
@aaed3153
Last seen 5 days ago
United States

Hello,

I am running DESeq2 with this metadata table -

Condition Time Batch
Control 0h 1
Control 12h 1
Control 24h 1
Control 0h 2
Control 12h 2
Control 24h 2
Control 0h 3
Control 12h 3
Control 24h 3
Control 0h 4
Control 12h 4
Control 24h 4
Treated 12h 1
Treated 24h 1
Treated 12h 2
Treated 24h 2
Treated 12h 3
Treated 24h 3
Treated 12h 4
Treated 24h 4

When I try to do the interactions, I get the error - "Error in solve.default(qr.R(qrx)) : 'a' (1 x 0) must be square" I would like to model interactions between condition and time, but I also noticed that the data has batch effects using the plotPCA function.

This is what my code looks like.


m1 <- model.matrix(~ Condition +Time + Batch, colData(dds)) # This works but doesn't contain the interaction I want

dds <- DESeqDataSetFromMatrix(countData = counts, colData = metadata, design = ~1)
m1 <- model.matrix(~ Condition + Condition:Batch + Condition:Time, data = metadata)
all.zero <- apply(m1, 2, function(x) all(x==0))
all.zero
idx <- which(all.zero)
m1 <- m1[,-idx]
dds <- DESeq(dds, test = "Wald", betaPrior = FALSE, full = m1, parallel = TRUE) 
using supplied model matrix
estimating size factors
estimating dispersions
gene-wise dispersion estimates
Error in solve.default(qr.R(qrx)) : 'a' (1 x 0) must be square
  1. Would it make sense to replicate the control 0h as treated 0h?
  2. I saw another post here where another user posted a similar error. How do I change the design in my experiment so it works?

Thank you! Priyanka

DESeq2 • 226 views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 2 days ago
United States

I would check the rank of your model matrix, and perhaps meet with a local statistician who can help you create an appropriate design matrix.

ADD COMMENT

Login before adding your answer.

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