Entering edit mode
I have a analysis in edgeR, but it ended by error.
This is my data:
Sample treat factor1 factor2
s1 CT 1 c1
s2 CT 1 c1
s3 CT 2 c1
s4 CT 2 c1
s5 CT 1 c2
s6 CT 2 c2
s7 CT 2 c2
s8 CT 1 c2
s9 CT 1 c2
s10 CT 2 c2
s11 treatmetn 2 c3
s12 treatmetn 2 c3
s13 treatmetn 1 c3
s14 treatmetn 2 c3
s15 treatmetn 1 c3
s16 treatmetn 2 c3
s17 treatmetn 1 c3
s18 treatmetn 2 c4
s19 treatmetn 2 c4
s20 treatmetn 2 c4
s21 treatmetn 1 c4
s22 treatmetn 2 c4
I used this formula for analysis
--formula "treat+factor1+factor2" \
at the end I have this error:
Error in glmFit.default(sely, design, offset = seloffset, dispersion = 0.05, :
Design matrix not of full rank. The following coefficients not estimable:
factor2C4
Calls: estimateDisp ... estimateDisp -> estimateDisp.default -> glmFit -> glmFit.default
Execution halted
Thanks for reply. factor1 is sex and factor 2 is effect of mother. I need to have both of them in the models. whats your propose? Thanks a lot!
As Gordon already noted, you cannot include both in your design matrix. The only alternative is to use the limma-voom pipeline and fit a GLS to account for the correlation between samples from the same mother. Something like
The issue is that mother is nested in treatment (e.g., the offspring for each mother is either treated or control), which is problematic. Ideally the offspring would have been randomized to the two treatment arms, in which case it would be possible to fit factor2 in the model as a fixed effect. It is crucial to design an experiment carefully to avoid this sort of thing.
Thanks James for the reply. When i use the factor2, I have a error at the end due to number of rows.
Its ok when i didn't use the factor2
You must have made a mistake in your code. Ideally you would provide a self-contained example. Here is an example of what that means.
Thank a lot. But I don't understand whats the mistake here, another error!
Here is something that you should be able to diagnose by yourself by simply reading the error message (they are usually meant to help!).
It says
Which clearly states what the problem is. The rows of your design matrix are supposed to correspond to each column of your data, and they are mis-matched (you have more of one than the other). You will have to inspect the design matrix and figure out where you went wrong.
samples are related to the methylation analysis