I am facing a problem with the analysis of some data. I keep getting the 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 followed the instructions reported in the vignette of DESeq2 in case of Group-specific condition effect, which is the case of my experimental design, but I am not able to solve the problem. This is my script:
counts <- data.frame(final_counts_clean) samples <- data.frame(condition=factor(rep(c("HN","LN"),each=6)), phenotype=factor(rep(c("HLR", "FLR", "ALR"),each=2)), genotype=factor(rep(c("A", "B", "C", "D", "E", "F"),4)), rep=factor(rep(1:2, each=12))) samples$ind.n <- factor(rep(rep(1:3,each=2),2)) as.data.frame(samples) matrix<-model.matrix(~ condition + condition:ind.n + condition:phenotype, samples) ds <- DESeqDataSetFromMatrix(countData=counts, colData=samples, design=matrix)
I don't have any "full zero" columns of missing interactions, which should be the cause of the error. I feel very lost.