Answers.Body: <p>DESeq2 is a package designed for calculating <em>differential</em> expression, in other words for comparing expression between two states. The primary results it produces are therefore comparative values (e.g. comparing DBA.2J and C57BL.6J in your case).</p>
  <p>Given that this does not seem to be your intended calculation, it would be helpful if you could provide more context around what you want to use DESeq2 for. If it's not for differential expression, there's likely a better tool / approach for solving your problem.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-07-15T00:20:18.407Z
Answers.LastActivityDate: 2023-07-15T00:20:18.407Z
Answers.UserDisplayName: gringer
Answers.Body: <p>So I was following along with a coding lesson from Youtube learning how to do differential expression in R, if the data had been my own I probably would have been able to figure out what needed to be done.
  The code that worked for me was</p>
  <p><code>dds &lt;- DESeqDataSetFromMatrix(countData = exprs(bottomly.eset), colData = pData(bottomly.eset), design = ~ strain)</code></p>
  <p><code>dds &lt;- DESeq(dds, betaPrior = TRUE)</code></p>
  <p>I was then able to use this code below which was resulting in the error previously
  <code>contrast.deseq2 &lt;- list(c(&quot;strainC57BL.6J&quot;, &quot;strainDBA.2J&quot;))</code></p>
  <p>Thank you to everyone who commented on this question</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-07-17T13:58:19.860Z
Answers.Text: I don't understand the difference between this and the `vs` offered by DESeq2 previously in your question. Given that the default test is Wald and betaPrior is TRUE by default for Wald tests, how is this result any different?
Answers.UserDisplayName: Ram RS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-07-17T21:07:45.310Z
Answers.Text: I'm not sure of the difference but this is the result I got when running the new code
Answers.UserDisplayName: Sabrina
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-07-18T13:03:06.233Z
Answers.Text: Run it both ways and see if the number of genes or fold change value differs by much. I honestly don't think there should be any significant difference.
Answers.UserDisplayName: Ram RS
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-07-15T10:59:50.467Z
Answers.LastActivityDate: 2023-07-15T10:59:50.467Z
Answers.UserDisplayName: Sabrina
Body: <p>I'm following along with some pre written code to learn how to do differential expression. I am using the same data set and have gone back through the code and copy and pasted what they used and the follow along gets the two headings rather than the single one that I am getting, so I'm a bit confused how I'm getting different results.</p>
  <p>I have some data which I have put through DESeq but the output for resultsNames isn't what I expect. The code is</p>
  <pre class="lang-r prettyprint-override"><code>dds &lt;- DESeqDataSetFromMatrix(countData = exprs(bottomly.eset), colData = pData(bottomly.eset), design = ~ strain)
  dds &lt;- DESeq(dds)
  </code></pre>
  <p>but this code produces this output <code>&quot;Intercept&quot;  &quot;strain_DBA.2J_vs_C57BL.6J&quot;</code> whereas the output that I intended was <code>&quot;Intercept&quot;  &quot;strain_DBA.2J&quot;   &quot;C57BL.6J&quot;</code></p>
  <p>Is there a simple way to change this within the code that I have or is this something related to the dataset I used?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-07-14T21:23:50.610Z
Comments.Text: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Comments.UserDisplayName: Community
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-07-14T22:04:17.060Z
Comments.Text: In your expectation, what is the `DBA.2J` strain tested against?
Comments.UserDisplayName: Ram RS
Tags: <differential-expression><deseq2>
Title: Understanding DESeq2 output for resultNames
ThreadText: # Understanding DESeq2 output for resultNames
  
  (Asked by: username_0 on 2023-07-14)
  
  I'm following along with some pre written code to learn how to do differential expression. I am using the same data set and have gone back through the code and copy and pasted what they used and the follow along gets the two headings rather than the single one that I am getting, so I'm a bit confused how I'm getting different results.
  
  I have some data which I have put through DESeq but the output for resultsNames isn't what I expect. The code is
  
  ```r
  dds <- DESeqDataSetFromMatrix(countData = exprs(bottomly.eset), colData = pData(bottomly.eset), design = ~ strain)
  dds <- DESeq(dds)
  
  ```
  
  but this code produces this output `"Intercept" "strain_DBA.2J_vs_C57BL.6J"` whereas the output that I intended was `"Intercept" "strain_DBA.2J" "C57BL.6J"`
  
  Is there a simple way to change this within the code that I have or is this something related to the dataset I used?
  
  **Tags:** differential-expression, deseq2
  
  > **Comments:**
  > **username_1**: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.  
  > **username_2**: In your expectation, what is the `DBA.2J` strain tested against?  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2023-07-15. Score: 2
  
  DESeq2 is a package designed for calculating *differential* expression, in other words for comparing expression between two states. The primary results it produces are therefore comparative values (e.g. comparing DBA.2J and C57BL.6J in your case).
  
  Given that this does not seem to be your intended calculation, it would be helpful if you could provide more context around what you want to use DESeq2 for. If it's not for differential expression, there's likely a better tool / approach for solving your problem.
  
  
  ---
  
  ### Answer by username_0 on 2023-07-15. Score: 2
  
  So I was following along with a coding lesson from Youtube learning how to do differential expression in R, if the data had been my own I probably would have been able to figure out what needed to be done.
  The code that worked for me was
  
  `dds <- DESeqDataSetFromMatrix(countData = exprs(bottomly.eset), colData = pData(bottomly.eset), design = ~ strain)`
  
  `dds <- DESeq(dds, betaPrior = TRUE)`
  
  I was then able to use this code below which was resulting in the error previously
  `contrast.deseq2 <- list(c("strainC57BL.6J", "strainDBA.2J"))`
  
  Thank you to everyone who commented on this question
  
  > **Comments:**
  > **username_2**: I don't understand the difference between this and the `vs` offered by DESeq2 previously in your question. Given that the default test is Wald and betaPrior is TRUE by default for Wald tests, how is this result any different?  
  > **username_0**: I'm not sure of the difference but this is the result I got when running the new code  
  > **username_2**: Run it both ways and see if the number of genes or fold change value differs by much. I honestly don't think there should be any significant difference.  
  
  ---
  
  