Thank you, Asaf. It works!
• 0 views
•
link
I have 4 factors in the design formula in DESeq2
dds <- DESeqDataSetFromMatrix(countData = cts,
colData = coldata,
design = ~ condition + gender + batch + genotype)
but got an error
Error 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.
This is what my coldata looks like:
condition gender batch genotype
s1 Sst_Input female GA770 Sst-Cre
s2 Sst_Input female GA770 Sst-Cre
s3 Sst_IP female GA770 Sst-Cre
s4 Sst_IP female GA770 Sst-Cre
s5 Pv_Input male GA806 Pv-Cre
s6 Pv_IP male GA806 Pv-Cre
s7 Pv_Input male GA806 Pv-Cre
s8 Pv_IP male GA806 Pv-Cre
s9 Sst_Input male GA806 Sst-Cre
s10 Sst_IP male GA806 Sst-Cre
s11 Pv_Input male GA806 Pv-Cre
s12 Pv_IP male GA806 Pv-Cre
s13 Sst_Input male GA806 Sst-Cre
s14 Sst_IP male GA806 Sst-Cre
s15 Sst_Input male GA838 Sst-Cre
s16 Sst_Input male GA838 Sst-Cre
s17 Sst_Input female GA838 Sst-Cre
s18 Sst_Input female GA838 Sst-Cre
s19 Sst_Input male GA838 Sst-Cre
s20 Sst_Input female GA838 Sst-Cre
s21 Sst_IP male GA838 Sst-Cre
s22 Sst_IP male GA838 Sst-Cre
s23 Sst_IP female GA838 Sst-Cre
s24 Sst_IP female GA838 Sst-Cre
s25 Sst_IP male GA838 Sst-Cre
s26 Sst_IP female GA838 Sst-Cre
row name indicates the simplified sample name
4 conditions: Sst_Input, Sst_IP, Pv_Input, Pv_IP
2 genders: female and male
3 batches: GA770, GA806, GA838
2 genotypes: Sst-Cre and Pv-Cre
Does anyone know how to solve this?
Your condition is nested in the genotype. You should change condition to "Input" and "IP" and then add the interaction term genotype:condition to your formula.
So coldata will look like:
condition gender batch genotype
s1 Input female GA770 Sst-Cre
s2 Input female GA770 Sst-Cre
s3 IP female GA770 Sst-Cre
s4 IP female GA770 Sst-Cre
s5 Input male GA806 Pv-Cre
s6 IP male GA806 Pv-Cre
s7 Input male GA806 Pv-Cre
s8 IP male GA806 Pv-Cre
s9 Input male GA806 Sst-Cre
s10 IP male GA806 Sst-Cre
s11 Input male GA806 Pv-Cre
s12 IP male GA806 Pv-Cre
s13 Input male GA806 Sst-Cre
s14 IP male GA806 Sst-Cre
s15 Input male GA838 Sst-Cre
s16 Input male GA838 Sst-Cre
s17 Input female GA838 Sst-Cre
s18 Input female GA838 Sst-Cre
s19 Input male GA838 Sst-Cre
s20 Input female GA838 Sst-Cre
s21 IP male GA838 Sst-Cre
s22 IP male GA838 Sst-Cre
s23 IP female GA838 Sst-Cre
s24 IP female GA838 Sst-Cre
s25 IP male GA838 Sst-Cre
s26 IP female GA838 Sst-Cre
and dds:
dds <- DESeqDataSetFromMatrix(countData = cts,
colData = coldata,
design = ~ condition + gender + batch + genotype + genotype:condition)
Thank you, Asaf. It works!
Log in to answer this question.