text: user3113: 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.
  
  user77: The help page for removeBatchEffect() explicitly states that it should not be used in conjunction with differential expression testing, so don't do that. You already have the batch effect included in your model, so you're already correcting for it when testing for differential expression. If your MDS plots suggest that samples are variably affected by the batch effect then look into the combat() function from the sva package.
  
original_text: 3113: <p>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.</p>
  
  <p>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. </p>
  
  <p>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.</p>
  
  <pre class="lang-r prettyprint-override"><code># define the experiment
  Batch &lt;- factor(c(1,2,3,1,2,3))
  Treatment &lt;- factor(c(0,0,0,1,1,1))
  design_noI &lt;- model.matrix(~ 0 + Batch + Treatment)
  
  # define our DGEList
  San &lt;- DGEList(counts=x,genes=gene_info)
  
  A &lt;- aveLogCPM(San)
  y2 &lt;- San[A&gt;1,]
  y2 &lt;- calcNormFactors(y2)
  logCPM &lt;- cpm(y2, log=TRUE, prior.count=5)
  plotMDS(logCPM)
  logCPMR &lt;- removeBatchEffect(y2, Clutch = Clutch)
  plotMDS(logCPMR)
  </code></pre>
  
  <p>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.</p>
  
  <pre class="lang-r prettyprint-override"><code># filter the lowly expresed genes and normalize the data
  keep &lt;- rowSums(cpm(San/logCPMR)&gt;1) &gt;= 3
  keep2 &lt;- removeBatchEffect(keep, Batch)
  y_group &lt;- San/logCPMR[keep2, , keep2.lib.size=FALSE]
  y_group &lt;- calcNormFactors(San/logCPMR)
  </code></pre>
  
  <p>I have mention the <code>San/logCPMR</code>, as <code>San</code> take as data without remove the batch effects, whereas I think <code>logCPMR</code> as batch effected removed data frame.</p>
  
  <p>Any suggestion on this more useful to me.</p>
  
  <p>Please let me know, any other information needed to deal with this batch effects.</p>
   77: <p>The help page for <code>removeBatchEffect()</code> explicitly states that it should not be used in conjunction with differential expression testing, so don't do that. You already have the batch effect included in your model, so you're already correcting for it when testing for differential expression. If your MDS plots suggest that samples are variably affected by the batch effect then look into the <code>combat()</code> function from the <code>sva</code> package.</p>
  