Deseq2 batch effect design issue
1
0
Entering edit mode
6.6 years ago
1769mkc ★ 1.2k

Im taking stage specific data so for one set im taking from one publication and other set from a different publication now the question comes about the batch since there might be many factors contributing to noise which might not contribute to the true biological variability so how do i remove the batch effect so i came across combat ,RUV ,sva, but there is also in deseq2 to define batch to resolve the batch effect .

so I have 4 sample from HSC and 2 sample from granulocyte which is from a different publication so im trying to define it in my design but im getting error there been similar issue i read but im not able to resolve ..

countdata <- read.table('HSC_Gran.txt', header=TRUE, row.names=1)
head(countdata)


countdata <- countdata[ ,6:ncol(countdata)]
colnames(countdata) <-  colnames(countdata)
countdata <- countdata[rowSums(countdata)>10,]

names(countdata)
length(countdata[,1])
countdata <- as.matrix(countdata)
head(countdata)
colnames(countdata)
condition <- factor(c(rep("Control", 4),rep("Test", 2)),levels=c("Control", "Test"))
batch <- factor(c(rep("A", 4),rep("B", 2)),levels=c("A", "B"))
(coldata <- data.frame(row.names=colnames(countdata), condition,batch))

dds <- DESeqDataSetFromMatrix(countData=countdata, colData=coldata, design=~condition:batch)

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.

Please read the vignette section 'Model matrix not full rank':

vignette('DESeq2')

I'm doing something incorrect in my design ,any suggestion or help would be highly appreciated

rna-seq R • 4.0k views
ADD COMMENT
1
Entering edit mode

You might want to look at my answer here, which may clarify your issues.

ADD REPLY
0
Entering edit mode

Additionally, you're looking at the interaction between condition and batch.

ADD REPLY
0
Entering edit mode

okay .so suggest me, as there are no mature samples which is my granulocyte from the same publication this is from a different lab/publication data so how do i remove the batch effect do comparison/differential analysis

ADD REPLY
1
Entering edit mode

As @JJ has already told you, this design cannot be made balanced. I'd suggest analysing the experiments separately, and if you really feel they're comparable, try a non-parametric approach such as RankProd for looking at the differences in respective fold changes.

ADD REPLY
1
Entering edit mode
6.6 years ago
JJ ▴ 710

I'm doing something incorrect in my design ,any suggestion or help would be highly appreciated

The error tells you that you provided a batch it cannot correct for, as your batch and condition is one and same. You can only omit the batch correction but then you will have a not corrected for it and your fold changes will be questionable.

ADD COMMENT
0
Entering edit mode

so what i understand is my design is unbalanced i saw the link which andrew gave link my question is how i do i modify so that i can get a balanced design?

ADD REPLY
0
Entering edit mode

You can't as you compare two separate experiments: batch and condition is one and same. You would have to do your own microarray experiment comparing HSC and granulocyte under the same conditions.

ADD REPLY

Login before adding your answer.

Traffic: 1983 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6