Answers.Body: <p>If both batches contain replicates of both groups (LT and C) then the presented code is what you should do, exactly pointed out in the vignette for the LRT: <a href="http://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#likelihood-ratio-test" rel="nofollow noreferrer">http://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#likelihood-ratio-test</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-24T10:14:01.697Z
Answers.Text: Thank you. Please, what do you mean by "If both batches contain replicates of both groups (LT and C)" ? I know each sample is one independent person and we have sent samples to Qiagen in two times
Answers.UserDisplayName: Zizogolu
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-24T21:24:24.653Z
Answers.Text: It means exactly like it reads. Both batches need to contain replicates (preferably in comparable numbers) of both groups. Use `table(meta$batch, meta$group)` to see the distribution contingency table.
Answers.UserDisplayName: Ram RS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-23T19:37:53.713Z
Answers.LastActivityDate: 2023-01-23T19:37:53.713Z
Answers.UserDisplayName: ATpoint
Body: <p>I have sent two sets (two batches in matter of sending for sequencing) of different samples (plasma) to small RNA-seq to Qiagen company</p>
  <p>This is how my meta data look</p>
  <pre><code>&gt; head(meta)
             batch group    sex
  30678.009 batch2     C   Male
  30678.010 batch2     C Female
  30941.001 batch1     C Female
  30941.002 batch1     C   Male
  30941.003 batch1     C   Male
  30941.004 batch1     C   Male
  &gt; tail(meta)
             batch group    sex
  30941.016 batch1    LT Female
  30941.017 batch1    LT   Male
  30941.019 batch1    LT   Male
  30941.022 batch1    LT Female
  30941.023 batch1    LT   Male
  30941.024 batch1    LT Female
  &gt;   
  </code></pre>
  <p>I want to extract differentially expressed RNAs between my two groups without batch effect</p>
  <p>I am doing this</p>
  <p>Is this correct please?</p>
  <pre><code>dds &lt;- DESeqDataSetFromMatrix(countData = count,
                                colData = meta,
                                design= ~ batch + group)
  
  dds &lt;- DESeq(dds, test=&quot;LRT&quot;, reduced=~batch)
  
  res &lt;- results(dds)
  resultsNames(dds) 
  
  [1] &quot;Intercept&quot;              &quot;batch_batch2_vs_batch1&quot; &quot;group_LT_vs_C&quot;         
  &gt; 
  </code></pre>
  
Tags: <r><deseq2><differential-expression><edger><batch-effects>
Title: Batch correction in differential expression analysis
ThreadText: # Batch correction in differential expression analysis
  
  (Asked by: username_0 on 2023-01-23)
  
  I have sent two sets (two batches in matter of sending for sequencing) of different samples (plasma) to small RNA-seq to Qiagen company
  
  This is how my meta data look
  
  ```
  > head(meta)
             batch group    sex
  30678.009 batch2     C   Male
  30678.010 batch2     C Female
  30941.001 batch1     C Female
  30941.002 batch1     C   Male
  30941.003 batch1     C   Male
  30941.004 batch1     C   Male
  > tail(meta)
             batch group    sex
  30941.016 batch1    LT Female
  30941.017 batch1    LT   Male
  30941.019 batch1    LT   Male
  30941.022 batch1    LT Female
  30941.023 batch1    LT   Male
  30941.024 batch1    LT Female
  >   
  
  ```
  
  I want to extract differentially expressed RNAs between my two groups without batch effect
  
  I am doing this
  
  Is this correct please?
  
  ```
  dds <- DESeqDataSetFromMatrix(countData = count,
                                colData = meta,
                                design= ~ batch + group)
  
  dds <- DESeq(dds, test="LRT", reduced=~batch)
  
  res <- results(dds)
  resultsNames(dds) 
  
  [1] "Intercept"              "batch_batch2_vs_batch1" "group_LT_vs_C"         
  > 
  
  ```
  
  **Tags:** r, deseq2, differential-expression, edger, batch-effects
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-01-23. Score: 2
  
  If both batches contain replicates of both groups (LT and C) then the presented code is what you should do, exactly pointed out in the vignette for the LRT: <http://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#likelihood-ratio-test>
  
  > **Comments:**
  > **username_0**: Thank you. Please, what do you mean by "If both batches contain replicates of both groups (LT and C)" ? I know each sample is one independent person and we have sent samples to Qiagen in two times  
  > **username_2**: It means exactly like it reads. Both batches need to contain replicates (preferably in comparable numbers) of both groups. Use `table(meta$batch, meta$group)` to see the distribution contingency table.  
  
  ---
  
  