Answers.Body: <p>There are a few ways to approach your question, as you're partly asking for an opinion on the best method. In my view, to analyze changes in gene expression over time between treatment and control groups, it’s obviously crucial to focus on the interaction between these variables in your model.</p>
  <p>I’d recommend setting up your DESeq2 model to include both time and treatment, along with their interaction term: <code>~ organ + diet + time + diet:time</code>.</p>
  <p>This setup allows you to focus on the interaction term (<code>diet:time</code>), which will highlight genes where the expression patterns over time differ between TREAT and CNTRL.</p>
  <p>Once you’ve looked at the interaction term, you can still go ahead and examine the TREAT vs. CNTRL contrasts at each specific time point to see when those differences are most significant.</p>
  <p>As for your concern about the linear regression not capturing non-linear relationships—it's a valid point. However, DESeq2 is generally &quot;robust enough&quot; for RNA-seq data. It really depends if you think that tradeoff is worth it because it allows you to compare estimates of variability and effect sizes across different conditions.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-08-26T09:16:04.263Z
Answers.Text: Thank you very much for your reply I appreciate the exchange.
Answers.UserDisplayName: Paul
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-08-23T20:29:20.770Z
Answers.LastActivityDate: 2024-08-23T20:29:20.770Z
Answers.UserDisplayName: stefanH
Body: <p>At hand I have RNA expression data of 6 organs from mice with treated and untreated diets, collected at consecutive time points, and I wonder how to design an analysis accordingly in <code>DESeq2</code>. I am rather new to applying <code>DESeq2</code>.</p>
  <p>Dietary treatment was started at 0 minutes, and now RNA sequencing data data is available for each of the time points at <code>0</code>, <code>30</code>, <code>60</code>, <code>120</code>, <code>240</code>, and <code>480</code> minutes, and for each dietary treatment (<code>TREAT</code>) and control (<code>CNTRL</code>) <em>(So, in total I have about 72 quadruplicates from 6 organs x 6 time points x 2 diets (<code>TREAT</code>/<code>CNTRL</code>))</em> .</p>
  <p><strong>I was wondering what the correct way is to obtain information about the differentielly  expressed genes (DEGS) between:</strong></p>
  <ol>
  <li>treatment and control - at each time point</li>
  <li>between each consecutive time point - <em>within</em> each diet (treatment and control)</li>
  </ol>
  <p><strong>The two possible solution I am consided are:</strong></p>
  <ol start="3">
  <li><p><em>As I encoded already as per <strong>Fig 1</strong> below:</em> I divided my data (for each organ) into sub-sets (<code>CNTRL</code> vs. <code>TREAT</code> <em>at</em> each time point, and <code>TREAT</code> <em>or</em> <code>CNTL</code> for each consecutive time point) and calculated DEGs individually - resulting in 16 distinct DEG lists (<strong>Fig 1</strong> below). <strong>The DESeq2 model formulae had only one term - time, or diet.</strong> To me this is a correct way - as the relationship between two time points or diets can adequately be described as a line - <strong>i.e. <code>1 ~ diet</code> at each time-point can only be meaningfully described as a (regression) line, and <code>1 ~ time</code> for 2 time points with each treatment can only be meaningfully described as a line.</strong> But then I assume I can't compare effect sizes.</p>
  </li>
  <li><p>I am wondering whether it would be more appropriate if I wanted to compare results to include both time and ant diet into the model formulae, and then pull out 16 different results list by supplying 16 different contrast - defined following the schematic in <strong>Fig. 1</strong>. To me that would make the DEG lists comparable to each other, but it appears incorrect because the real observations across all time points could likely hardly be solved by linear regression - in other words the relationship <code>1 ~ diet * time</code> across all genes is not a very large collection of lines with different slopes, but rather a collection of curves that can't be solved with linear regression.</p>
  </li>
  </ol>
  <p>I'd be happy to receive some feedback or thoughts how to approach this analysis <strong>In essence the one question I am entertaining is: Would you also choose approach 1, or rather 2, or a different approach entirely?</strong></p>
  <p>Kind regards, Paul</p>
  <p><a href="https://i.sstatic.net/OlUeCNW1.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/OlUeCNW1.jpg" alt="Schematic of 16 DEG list" /></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-08-21T10:58:21.973Z
Comments.Text: I appreciate the level of detail in the question, however please edit and focus the post on a single question. You can then always ask follow-up questions. The site works on a one question - one answer format.
Comments.UserDisplayName: M__
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-08-22T12:15:13.057Z
Comments.Text: Thank you for the hint, I have edited my post to only contain one question.
Comments.UserDisplayName: Paul
Tags: <rna-seq><bioconductor><deseq2><modelling>
Title: Deseq2 model formula and longitudinal experimatal (or time-series) designs
ThreadText: # Deseq2 model formula and longitudinal experimatal (or time-series) designs
  
  (Asked by: username_0 on 2024-08-19)
  
  At hand I have RNA expression data of 6 organs from mice with treated and untreated diets, collected at consecutive time points, and I wonder how to design an analysis accordingly in `DESeq2`. I am rather new to applying `DESeq2`.
  
  Dietary treatment was started at 0 minutes, and now RNA sequencing data data is available for each of the time points at `0`, `30`, `60`, `120`, `240`, and `480` minutes, and for each dietary treatment (`TREAT`) and control (`CNTRL`) *(So, in total I have about 72 quadruplicates from 6 organs x 6 time points x 2 diets (`TREAT`/`CNTRL`))* .
  
  **I was wondering what the correct way is to obtain information about the differentielly expressed genes (DEGS) between:**
  
  1. treatment and control - at each time point
  2. between each consecutive time point - *within* each diet (treatment and control)
  
  **The two possible solution I am consided are:**
  
  3. *As I encoded already as per **Fig 1** below:* I divided my data (for each organ) into sub-sets (`CNTRL` vs. `TREAT` *at* each time point, and `TREAT` *or* `CNTL` for each consecutive time point) and calculated DEGs individually - resulting in 16 distinct DEG lists (**Fig 1** below). **The DESeq2 model formulae had only one term - time, or diet.** To me this is a correct way - as the relationship between two time points or diets can adequately be described as a line - **i.e. `1 ~ diet` at each time-point can only be meaningfully described as a (regression) line, and `1 ~ time` for 2 time points with each treatment can only be meaningfully described as a line.** But then I assume I can't compare effect sizes.
  4. I am wondering whether it would be more appropriate if I wanted to compare results to include both time and ant diet into the model formulae, and then pull out 16 different results list by supplying 16 different contrast - defined following the schematic in **Fig. 1**. To me that would make the DEG lists comparable to each other, but it appears incorrect because the real observations across all time points could likely hardly be solved by linear regression - in other words the relationship `1 ~ diet * time` across all genes is not a very large collection of lines with different slopes, but rather a collection of curves that can't be solved with linear regression.
  
  I'd be happy to receive some feedback or thoughts how to approach this analysis **In essence the one question I am entertaining is: Would you also choose approach 1, or rather 2, or a different approach entirely?**
  
  Kind regards, username_0
  
  [![Schematic of 16 DEG list](https://i.sstatic.net/OlUeCNW1.jpg)](https://i.sstatic.net/OlUeCNW1.jpg)
  
  **Tags:** rna-seq, bioconductor, deseq2, modelling
  
  > **Comments:**
  > **username_1**: I appreciate the level of detail in the question, however please edit and focus the post on a single question. You can then always ask follow-up questions. The site works on a one question - one answer format.  
  > **username_0**: Thank you for the hint, I have edited my post to only contain one question.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2024-08-23. Score: 1 | Accepted answer
  
  There are a few ways to approach your question, as you're partly asking for an opinion on the best method. In my view, to analyze changes in gene expression over time between treatment and control groups, it’s obviously crucial to focus on the interaction between these variables in your model.
  
  I’d recommend setting up your DESeq2 model to include both time and treatment, along with their interaction term: `~ organ + diet + time + diet:time`.
  
  This setup allows you to focus on the interaction term (`diet:time`), which will highlight genes where the expression patterns over time differ between TREAT and CNTRL.
  
  Once you’ve looked at the interaction term, you can still go ahead and examine the TREAT vs. CNTRL contrasts at each specific time point to see when those differences are most significant.
  
  As for your concern about the linear regression not capturing non-linear relationships—it's a valid point. However, DESeq2 is generally "robust enough" for RNA-seq data. It really depends if you think that tradeoff is worth it because it allows you to compare estimates of variability and effect sizes across different conditions.
  
  > **Comments:**
  > **username_0**: Thank you very much for your reply I appreciate the exchange.  
  
  ---
  
  