Answers.Body: <p><code>condition_t_vs_control</code> gives the effect of condition, <code>conditiont.time</code> is the interaction of condition and time. If you wanted to test the effect of time, use <code>name=&quot;time&quot;</code>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-19T16:35:51.870Z
Answers.Text: Thank you, using which contrast I can get the difference of IT versus control but considering time goes from 24 hours to 48 hours?
Answers.UserDisplayName: Zizogolu
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-19T19:22:02.617Z
Answers.Text: Just condition_IT_vs_control, since time is compensated for by fitting all coefficients at the same time (let me know if that phrasing is confusing).
Answers.UserDisplayName: Devon Ryan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-26T16:06:41.350Z
Answers.Text: Sorry @Devon Ryan I get  error for ddsTC <- DESeq(dds, test="LRT", reduced = ~ time + time:condition)                                                                                                       error in nbinomLRT(object, full = full, reduced = reduced, quiet = quiet,  : 
    less than one degree of freedom, perhaps full and reduced models are not in the correct order  what should I do please ?
Answers.UserDisplayName: Zizogolu
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-26T16:24:57.067Z
Answers.Text: Make sure to specify the full model, I don't know what that defaults to.
Answers.UserDisplayName: Devon Ryan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-26T17:25:38.090Z
Answers.Text: Thank you so much for your answer, I think this is my full model                                              dds <- DESeqDataSetFromMatrix(countData=a,colData=design, design=~time + condition + time:condition)   am I right? design=~time + condition + time:condition  When I try to reduce that by removing reduced = ~ time + time:condition I get error
Answers.UserDisplayName: Zizogolu
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-26T18:13:18.367Z
Answers.Text: Then convert time to a factor. Perhaps that will solve the problem. You have enough samples that you shouldn’t run into this issue. BTW you can use the default Wald test instead and avoid the error.
Answers.UserDisplayName: Devon Ryan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-27T10:30:03.147Z
Answers.Text: Thank you so much says that > ddsTC <- DESeq(dds,reduced = ~ time + time:condition)
  Error in DESeq(dds, reduced = ~time + time:condition) : 
    'reduced' ignored when test='Wald'
  >
Answers.UserDisplayName: Zizogolu
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-27T11:48:31.797Z
Answers.Text: Correct, there is no reduced formula with a Wald test, you just extract the appropriate coefficients with lfcShrink()
Answers.UserDisplayName: Devon Ryan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-12T20:22:38.123Z
Answers.LastActivityDate: 2021-10-27T12:13:37.103Z
Answers.LastEditDate: 2021-10-27T12:13:37.103Z
Answers.UserDisplayName: Devon Ryan
Body: <p>I have a treatment and control in two time points like this</p>
  <pre><code> &gt; design
                                   X condition time
      1       CTRL_24_hrs_replicate1   control   24
      2       CTRL_24_hrs_replicate2   control   24
      3       CTRL_24_hrs_replicate3   control   24
      4  treatment_24_hrs_replicate1        t   24
      5  treatment_24_hrs_replicate2        t   24
      6  treatment_24_hrs_replicate3        t   24
      7       CTRL_48_hrs_replicate1   control   48
      8       CTRL_48_hrs_replicate2   control   48
      9       CTRL_48_hrs_replicate3   control   48
      10 treatment_48_hrs_replicate1        t   48
      11 treatment_48_hrs_replicate2        t   48
      12 treatment_48_hrs_replicate3        t   48
      &gt; 
  
                                                 
      
  </code></pre>
  <p>I want to test between between treatment and control considering time point 2 hours to 4 hours</p>
  <p>I have done like this</p>
  <pre><code>dds &lt;- DESeqDataSetFromMatrix(countData=a,colData=design, design=~time + condition + time:condition)
  
  ddsTC &lt;- DESeq(dds, test=&quot;LRT&quot;, reduced = ~ time + time:condition)
  
  &gt; resultsNames(ddsTC)
  [1] &quot;Intercept&quot;                &quot;condition_t_vs_control&quot;  
  [3] &quot;time&quot;                     &quot;conditiont.time&quot; 
  
   
  </code></pre>
  <p>What is the difference of the results of these codes</p>
  <pre><code>results(ddsTC, name=&quot;condition_t_vs_control&quot;, test=&quot;Wald&quot;)
  </code></pre>
  <p><strong>versus</strong></p>
  <pre><code>results(ddsTC, name=&quot;conditiont.time&quot;, test=&quot;Wald&quot;)
  </code></pre>
  <p>Actually I want to know what <code>condition_t_vs_control</code> gives and what <code>conditiont.time</code> gives</p>
  <p>Thank you so much for any intuition</p>
  
Tags: <rna-seq><differential-expression><deseq2>
Title: Different contrasts in DESeq2
ThreadText: # Different contrasts in DESeq2
  
  (Asked by: username_0 on 2021-10-11)
  
  I have a treatment and control in two time points like this
  
  ```
   > design
                                   X condition time
      1       CTRL_24_hrs_replicate1   control   24
      2       CTRL_24_hrs_replicate2   control   24
      3       CTRL_24_hrs_replicate3   control   24
      4  treatment_24_hrs_replicate1        t   24
      5  treatment_24_hrs_replicate2        t   24
      6  treatment_24_hrs_replicate3        t   24
      7       CTRL_48_hrs_replicate1   control   48
      8       CTRL_48_hrs_replicate2   control   48
      9       CTRL_48_hrs_replicate3   control   48
      10 treatment_48_hrs_replicate1        t   48
      11 treatment_48_hrs_replicate2        t   48
      12 treatment_48_hrs_replicate3        t   48
      > 
  
                                                 
      
  
  ```
  
  I want to test between between treatment and control considering time point 2 hours to 4 hours
  
  I have done like this
  
  ```
  dds <- DESeqDataSetFromMatrix(countData=a,colData=design, design=~time + condition + time:condition)
  
  ddsTC <- DESeq(dds, test="LRT", reduced = ~ time + time:condition)
  
  > resultsNames(ddsTC)
  [1] "Intercept"                "condition_t_vs_control"  
  [3] "time"                     "conditiont.time" 
  
   
  
  ```
  
  What is the difference of the results of these codes
  
  ```
  results(ddsTC, name="condition_t_vs_control", test="Wald")
  
  ```
  
  **versus**
  
  ```
  results(ddsTC, name="conditiont.time", test="Wald")
  
  ```
  
  Actually I want to know what `condition_t_vs_control` gives and what `conditiont.time` gives
  
  Thank you so much for any intuition
  
  **Tags:** rna-seq, differential-expression, deseq2
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-10-12. Score: 3
  
  `condition_t_vs_control` gives the effect of condition, `conditiont.time` is the interaction of condition and time. If you wanted to test the effect of time, use `name="time"`.
  
  > **Comments:**
  > **username_0**: Thank you, using which contrast I can get the difference of IT versus control but considering time goes from 24 hours to 48 hours?  
  > **username_1**: Just condition_IT_vs_control, since time is compensated for by fitting all coefficients at the same time (let me know if that phrasing is confusing).  
  > **username_0**: Sorry @username_1 I get  error for ddsTC <- DESeq(dds, test="LRT", reduced = ~ time + time:condition)                                                                                                       error in nbinomLRT(object, full = full, reduced = reduced, quiet = quiet,  :    less than one degree of freedom, perhaps full and reduced models are not in the correct order  what should I do please ?  
  > **username_1**: Make sure to specify the full model, I don't know what that defaults to.  
  > **username_0**: Thank you so much for your answer, I think this is my full model                                              dds <- DESeqDataSetFromMatrix(countData=a,colData=design, design=~time + condition + time:condition)   am I right? design=~time + condition + time:condition  When I try to reduce that by removing reduced = ~ time + time:condition I get error  
  > **username_1**: Then convert time to a factor. Perhaps that will solve the problem. You have enough samples that you shouldn’t run into this issue. BTW you can use the default Wald test instead and avoid the error.  
  > **username_0**: Thank you so much says that > ddsTC <- DESeq(dds,reduced = ~ time + time:condition) Error in DESeq(dds, reduced = ~time + time:condition) :    'reduced' ignored when test='Wald' >  
  > **username_1**: Correct, there is no reduced formula with a Wald test, you just extract the appropriate coefficients with lfcShrink()  
  
  ---
  
  