Question: Design matrix: DESeq2
0
6 weeks ago by
INDIA
Gyan Prakash Mishra0 wrote:

Hi all,

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

deseq2 • 101 views
modified 6 weeks ago • written 6 weeks ago by Gyan Prakash Mishra0
1
6 weeks ago by
Michael Love23k
United States
Michael Love23k wrote:

Group is nested within batch. So controlling for batch and group is not possible. Take a look at the section of the vignette that the complete error message directs you to. Here you should just change the design to ~group

Yes I understood that it would be difficult to model batch and group since it is nested. so I guess using only ~group in design should take care of variance and depth across the sample.

I did pca analysis using vst, I think its the sample looks fine here. please comment your views

vsd <- vst(dds, blind=FALSE)
plotPCA(vsd, intgroup=c("genotype","condition", "Rep"))