<p>If you have an existing understanding of a fold change that you would consider to be biologically relevant, it will be better to use the lfcThreshold for comparisons. Working out that fold change is the hard bit.</p>
<p>When using the Wald test, the p-value is associated specifically with that threshold, rather than the difference from zero.</p>
<p>This is explained in the <a href="https://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#tests-of-log2-fold-change-above-or-below-a-threshold" rel="nofollow noreferrer">DESeq2 Analysis Vignette</a>:</p>
<blockquote>
<p>It is also possible to provide thresholds for constructing Wald tests of significance. Two arguments to the <em>results</em> function allow for threshold-based Wald tests: <code>lfcThreshold</code>, which takes a numeric of a non-negative threshold value, and <code>altHypothesis</code>, which specifies the kind of test. Note that the alternative hypothesis is specified by the user, i.e. those genes which the user is interested in finding, and the test provides <span class="math-container">$p$</span> values for the null hypothesis, the complement of the set defined by the alternative. The <code>altHypothesis</code> argument can take one of the following four values, where <span class="math-container">$β$</span> is the log2 fold change specified by the <code>name</code> argument, and <span class="math-container">$x$</span> is the <code>lfcThreshold</code>.</p>
<ul>
<li>greaterAbs - <span class="math-container">$|β|&gt;x$</span> - tests are two-tailed</li>
<li>lessAbs - <span class="math-container">$|β|&lt;x$</span> - p values are the maximum of the upper and lower tests</li>
<li>greater - <span class="math-container">$β&gt;x$</span></li>
<li>less - <span class="math-container">$β&lt;−x$</span></li>
</ul>
</blockquote>

CC BY-SA 4.0
2021-07-23T22:08:40.000Z
2021-07-23T22:08:40.000Z
gringer
<p>In DESeq2 you can identify your differentially expressed (DE) genes using the results function. I noticed people in my lab using the results() function with the minimum number of arguments supplied (below) and then converting the resulting object to a data frame filtering for the genes they considered DE (where they considered a fold change of +/- 2 and a p-value of 0.05 to be DE).</p>
<pre><code>res1 &lt;- results(dds, contrast(condition, treated, untreated))
</code></pre>
<p>Alternatively, I noticed that the results function allows you to set both the P-value and minimum fold change when you use the 'altHypothesis' argument (below). The resulting list from using this method is considerably shorter than the list from manually filtering for the same P-value and fold change. I am aware that that by using the 'altHypothesis' argument it comparisons are made using a Wald test rather than a LRT test, however, I am completely unfamiliar with these two tests and I was not able to understand their significant differences in the context of RNA-seq analysis.</p>
<pre><code>res1 &lt;- results(dds, contrast(condition, treated, untreated), alpha = 0.1, lfcThreshold = 1, altHypothesis = &quot;greaterAbs&quot;)
</code></pre>
<p>Due to the difference in size of the lists, and the goal of being consistent moving forward for the lab, does anyone have any insight as too which one is better? Neither myself or my lab are particularly used to this analysis but we would like to try to follow best practices as much as possible.</p>
<p>Thank you</p>

CC BY-SA 4.0
2023-03-06T18:43:16.523Z
I love that Deseq2 has altHypothesis="lessAbs" !!!!!!! I've used it a ton for RNA-seq. However, now I'm working with mass spect data using limma. Is there a way to make limma do the same thing?
Mary Allen
CC BY-SA 4.0
2023-03-06T19:32:31.763Z
@MaryAllen welcome to the site. You might consider asking the question in your comment as a separate question. There is a fair bit of popularity for `DSeq2` here
M__
<rna-seq><bioconductor><deseq2>
DESeq2. Which is better: using the altHypothesis argument in the results function or manually filtering for your desired P-value and Log2FoldChange?
# DESeq2. Which is better: using the altHypothesis argument in the results function or manually filtering for your desired P-value and Log2FoldChange?

(Asked by: username_0 on 2021-07-21)

In DESeq2 you can identify your differentially expressed (DE) genes using the results function. I noticed people in my lab using the results() function with the minimum number of arguments supplied (below) and then converting the resulting object to a data frame filtering for the genes they considered DE (where they considered a fold change of +/- 2 and a p-value of 0.05 to be DE).
res1 <- results(dds, contrast(condition, treated, untreated))

Alternatively, I noticed that the results function allows you to set both the P-value and minimum fold change when you use the 'altHypothesis' argument (below). The resulting list from using this method is considerably shorter than the list from manually filtering for the same P-value and fold change. I am aware that that by using the 'altHypothesis' argument it comparisons are made using a Wald test rather than a LRT test, however, I am completely unfamiliar with these two tests and I was not able to understand their significant differences in the context of RNA-seq analysis.
res1 <- results(dds, contrast(condition, treated, untreated), alpha = 0.1, lfcThreshold = 1, altHypothesis = "greaterAbs")

Due to the difference in size of the lists, and the goal of being consistent moving forward for the lab, does anyone have any insight as too which one is better? Neither myself or my lab are particularly used to this analysis but we would like to try to follow best practices as much as possible.
Thank you

**Tags:** rna-seq, bioconductor, deseq2
> **Comments:**
> **username_1**: I love that Deseq2 has altHypothesis="lessAbs" !!!!!!! I've used it a ton for RNA-seq. However, now I'm working with mass spect data using limma. Is there a way to make limma do the same thing?  
> **username_2**: @MaryAllen welcome to the site. You might consider asking the question in your comment as a separate question. There is a fair bit of popularity for `DSeq2` here  

---

## 1 answers

### Answer by username_3 on 2021-07-23. Score: 1 | Accepted answer

If you have an existing understanding of a fold change that you would consider to be biologically relevant, it will be better to use the lfcThreshold for comparisons. Working out that fold change is the hard bit.

When using the Wald test, the p-value is associated specifically with that threshold, rather than the difference from zero.

This is explained in the [DESeq2 Analysis Vignette](https://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#tests-of-log2-fold-change-above-or-below-a-threshold):

> It is also possible to provide thresholds for constructing Wald tests of significance. Two arguments to the *results* function allow for threshold-based Wald tests: `lfcThreshold`, which takes a numeric of a non-negative threshold value, and `altHypothesis`, which specifies the kind of test. Note that the alternative hypothesis is specified by the user, i.e. those genes which the user is interested in finding, and the test provides $p$ values for the null hypothesis, the complement of the set defined by the alternative. The `altHypothesis` argument can take one of the following four values, where $β$ is the log2 fold change specified by the `name` argument, and $x$ is the `lfcThreshold`.
>
> * greaterAbs - $|β|>x$ - tests are two-tailed
> * lessAbs - $|β| - p values are the maximum of the upper and lower tests
> * greater - $β>x$
> * less - $β<−x$


---

