Hello everyone,
I'm performing a RNA-seq analysis using DESeq2 and I'm wondering what is the correct analysis approach for my multifactor design. We have searched different posts in different forums and I can't figure out how to approach it.
Here I paste my multifactor design:
Using a ~batch + condition design, we obtained the following error:
some variables in design formula are characters, converting to factorsError 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.
We have also checked DESeq2 multiple factors nested design and we are still obtaining the same error. What is the correct factor design for this experiment?
Thank you so much for advance, David.
Is this the full design matrix? Because it looks full rank to me.
Can you run
model.matrix(~batch + condition, data=design)
, where design is your design matrix above and tell us if any of the columns are all zero?and post a sample of the
head
of the resulting table.Thank you for your time. The complete resulting table is:
I definately can't reproduce this - if I run deseq2 on the design matrix you posted, it works fine.
Did you type down these information by hand or did you read this somehow programatically? Could be some hidden whitespaces somewhere which then would artifically create a new unwanted group. Make a data.frame out of this design, convert it to factor and then check the levels of the columns to be what you want. Must be four levels for condition and three for batch.
Thank you for your time and your hints. I did a file (named samples.txt) to introduce data and i have checked it and it's ok. What we want is to incorporate to our design all of the aforementioned parameters (condition, batch and exp). We are trying to correct batch effect associated to the library preparation (columns "batch") and experiment (column "exp").
If you need any extra data or our code, please let me know.
Thank you, David.
Ah! Are you correcting by both batch AND experiment? You can't do that because the batches are composed of the experiments.
Thank you for your comments.
So is exp now included or not? Above in the question you only mention batch and condition.
Please provide the output of
dput(cdata)
wherecdata
is the data.frame with the colData information, and please provide the exact command for creating the dds.The commands we use are:
And the output of of dput(cdata) (its name is different in my case) is: