I am using the R (using EdgeR) for the RNA Seq analysis, I had few batch effect samples like Control vs treatment. Could anyone tell me the best way to remove the batch effects.
I have looked into the cluster dendrogram and MDS post (using EdgeR), the Control and Treatments are not grouping together, and their is differences in the different batch within Control and Treatment.
I tried this syntax to remove the batch effects for the rest of the analysis to get the DE Genelist. I feel it didn't able to remove the batch effects from the rest of the analysis.
# define the experiment
Batch <- factor(c(1,2,3,1,2,3))
Treatment <- factor(c(0,0,0,1,1,1))
design_noI <- model.matrix(~ 0 + Batch + Treatment)
# define our DGEList
San <- DGEList(counts=x,genes=gene_info)
A <- aveLogCPM(San)
y2 <- San[A>1,]
y2 <- calcNormFactors(y2)
logCPM <- cpm(y2, log=TRUE, prior.count=5)
plotMDS(logCPM)
logCPMR <- removeBatchEffect(y2, Clutch = Clutch)
plotMDS(logCPMR)
I can see the difference in MDS plot on removing the batch effects but I couldn't able to carry the same data flow into my rest of analysis.
# filter the lowly expresed genes and normalize the data
keep <- rowSums(cpm(San/logCPMR)>1) >= 3
keep2 <- removeBatchEffect(keep, Batch)
y_group <- San/logCPMR[keep2, , keep2.lib.size=FALSE]
y_group <- calcNormFactors(San/logCPMR)
I have mention the San/logCPMR
, as San
take as data without remove the batch effects, whereas I think logCPMR
as batch effected removed data frame.
Any suggestion on this more useful to me.
Please let me know, any other information needed to deal with this batch effects.