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?