Answers.Body: <ol>
  <li><p>I don't know how to do this in Limma, but in DESeq2 I would add the ROI as a separate factor in the design formula (without doing an explicit comparison), i.e. <code>design = ~ Group + ROI</code></p>
  </li>
  <li><p>Given that you don't need to do a cross-class comparison, I would subset the data into pos and neg classes, then do separate differential expression comparisons testing just the group variable.</p>
  </li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-07-21T23:50:00.243Z
Answers.LastActivityDate: 2024-07-21T23:50:00.243Z
Answers.UserDisplayName: gringer
Body: <p>I am performing differential expression analysis using the <code>limma</code> package on DSP GeoMx data, and I have a question regarding the handling of multiple ROIs per core. Below is a snippet of my sample information:</p>
  <pre><code>ROIs Class  Group
  A1   pos    Pre
  A1   neg    Pre
  A1   neg    Pre
  B1   pos    Post
  B1   pos    Post
  C1   neg    Post
  C1   pos    Post
  D1   neg    Pre
  D1   neg    Pre
  E1   neg    Post
  E1   pos    Post
  F1   pos    Pre
  </code></pre>
  <p>The unique patient IDs are A1, B1, C1, D1, E1, and F1.
  My aim is to identify DEGs between <code>Pre Vs Post in neg Class</code> and DEGs between <code>Pre Vs Post in pos Class</code></p>
  <p>I have the following questions:</p>
  <ol>
  <li>How can I adjust for the subsampling per tissue, considering that the multiple regions of interest placed per tissue section are not independent observations?</li>
  <li>How do I create a design formula to incorporate both the <code>Class</code> and <code>Group</code> variables for the <code>limma</code> analysis?</li>
  </ol>
  <p>Thank you in advance for your assistance.</p>
  
Tags: <r><limma><design>
Title: DGE Analysis using Limma on DSP GeoMx Data: Handling Multiple ROIs per Core
ThreadText: # DGE Analysis using Limma on DSP GeoMx Data: Handling Multiple ROIs per Core
  
  (Asked by: username_0 on 2024-07-20)
  
  I am performing differential expression analysis using the `limma` package on DSP GeoMx data, and I have a question regarding the handling of multiple ROIs per core. Below is a snippet of my sample information:
  
  ```
  ROIs Class  Group
  A1   pos    Pre
  A1   neg    Pre
  A1   neg    Pre
  B1   pos    Post
  B1   pos    Post
  C1   neg    Post
  C1   pos    Post
  D1   neg    Pre
  D1   neg    Pre
  E1   neg    Post
  E1   pos    Post
  F1   pos    Pre
  
  ```
  
  The unique patient IDs are A1, B1, C1, D1, E1, and F1.
  My aim is to identify DEGs between `Pre Vs Post in neg Class` and DEGs between `Pre Vs Post in pos Class`
  
  I have the following questions:
  
  1. How can I adjust for the subsampling per tissue, considering that the multiple regions of interest placed per tissue section are not independent observations?
  2. How do I create a design formula to incorporate both the `Class` and `Group` variables for the `limma` analysis?
  
  Thank you in advance for your assistance.
  
  **Tags:** r, limma, design
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-07-21. Score: 1
  
  1. I don't know how to do this in Limma, but in DESeq2 I would add the ROI as a separate factor in the design formula (without doing an explicit comparison), i.e. `design = ~ Group + ROI`
  2. Given that you don't need to do a cross-class comparison, I would subset the data into pos and neg classes, then do separate differential expression comparisons testing just the group variable.
  
  
  ---
  
  