I have 20 samples, four genotype , three stimulation with two replicate each sequenced in two batch please see below table.
coldata <- data.frame(row.names=colnames(countdata),genotype,Rep,stimulation,batch) coldata$group<- factor(paste0(coldata$stimulation,"_",coldata$genotype)) dds <- DESeqDataSetFromMatrix(countData=countdata, colData=coldata, design=~group)
I used group for the design first but as I have sample from two different batch, I also would like to include batch effect into the model. I thought I would include batch as
dds <- DESeqDataSetFromMatrix(countData=countdata, colData=coldata, design=~batch+group)
but I am getting error
the model matrix is not full rank, so the model cannot be fit as specified.
Can somebody help in understanding how can i create design matrix to include batch effect in my design matrix.
I would appreciate any help Thanks