Hi. Thanks for suggestion. I did not understand what do you mean by remove batch effects if the function doesn't model for batch effects. How to do that?scripts?
Hi everyone,
I need a help.
I have RNA seq data from multiple labs which I downloaded and processed by myself. I created a featurecounts matrix. Now I have two queries:
Do I need to remove batch effects? If yes can Deseq2 design matrix (~batch +condition) will be sufficient? Or I need to separately do batch removal (eg. I also tried Combat)?
After correcting/ not correcting for batch should I use approach as given in deseq2 or manually for plotting dendrograms cluster.
a). Deseq2 (no batch correction just ~batch +condition) in design matrix which gives dds object. Here I setup some commands as follows:
vsd <- vst(dds, blind=FALSE)
sampleDists <- dist(t(assay(vsd)))
sampleDistshc <- hclust(sampleDists, method = "ward.D")
plot(sampleDistshc)
b). Or I should correct batch: using Combat (sva) then apply:
Tbatchcorrectedmatrix <- t(batchcorrectedmatrix)
sampleDists <- dist(scale(Tbatchcorrectedmatrix), method = "euclidean")
sampleDistshc <- hclust(sampleDists, method = "ward.D")
plot(sampleDistshc)
I also noticed combat output gives me negative values. Why it is so and how to correct it?
Please help.
If possible please correct my R codes.
Thanks
1 answer
You have to model the batch effect for differential analysis and remove batch effects (comBat or removeBatchEffect() from limma) for plotting/clustering etc.
Combat gives negative values because it regresses out the batch effect, hence the values are modified.
Bottom line is, model for the batch variable wherever possible (DESeq2 design)and remove batch effects if the function doesn't model for batch effects ( like clustering, heatmaps etc )
for example, clustering function doesn't account (or model) for batch variation and it clusters whatever values you provide. likewise plotting functions. So in those cases you need to remove batch effects beforehand.
Ok I understood.
So I can use either Deseq2 approach (1) or Manual (2). Which one do you suggest ? Are the commands fine?
Log in to answer this question.
Hi i urgently need suggestions for this query. Please help