Trying to use deseq2 for differential expression analysis (rna-seq) between three groups and also account for batch effect as the control were sequenced at a different time point.
- control: con
- sample with mutation A: mutA
- sample with mutation B: mutB
here is my design
sample condition batch 1 C_1 con 1 2 C_2 con 1 3 C_5 con 1 4 C_3 con 1 5 C_4 con 1 6 M_6 mutA 2 7 M_2 mutA 2 8 M_5 mutA 2 9 M_1 mutA 2 10 M_4 mutA 2 11 M_3 mutA 2 12 MA_2 mutB 2 13 MA_6 mutB 2 14 MA_5 mutB 2 15 MA_4 mutB 2 16 MA_3 mutB 2 17 MA_1 mutB 2
when i create matrix:
dds <- DESeqDataSetFromMatrix(countData = data, colData = coldata, design = ~batch + condition)
I see this 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.
I also tried to compare only two conditions subsetting the original data, i still see the same error what am i missing?