<p>Yes, you can use the second one for volcano plots, but it might help to understand what it's implying.</p>
<p>The difference between these formulas is in the <code>mean</code> calculation. The following equations are identical:</p>
<pre><code>log(a/b)
</code></pre>
<p>and</p>
<pre><code>log(a) - log(b)
</code></pre>
<p>However, in your example, the first equation calculates the mean prior to doing the log, whereas the second example does the log first (i.e. <code>log(mean(Group1))</code> vs <code>mean(log(Group1))</code>).</p>
<p>As a consequence, the equations are <em>similar</em>, but not identical, and that difference depends on the underlying assumptions of the expression model.</p>
<p>In the first equation (what you call 'Actual'), the genes are assumed to follow a normal distribution in linear space, whereas in the second equation they're assumed to follow a normal distribution in <em>log</em> space.</p>
<p>Which one of these is correct is a subject of debate. It's pretty much established that gene expression for <em>all genes together</em> is log-normal (or, at least, much closer to log-normal than to linear), but whether this applies at an individual gene level is less clear.</p>
<p>In most cases, the results will be similar when looking at individual genes, and the equations can be used interchangeably. Where they differ substantially, there will be large expression differences between genes, so it's unlikely to alter the interpretation of results.</p>

CC BY-SA 4.0
2021-06-07T02:06:03.973Z
2021-06-07T02:06:03.973Z
gringer
<p>You can use what limma reports for everything, including volcano plots. In the post you link to I describe in a comment why this is done in every package that I know.</p>

CC BY-SA 4.0
2020-08-20T21:38:11.743Z
2020-08-20T21:38:11.743Z
Devon Ryan
<p>It seems that we have two calculations of log fold change:</p>
<p><code>Actual log2(FC) = log2(mean(Group1)/mean(Group2))</code></p>
<p><code>Limma's &quot;Log(FC)&quot; = mean(log2(Group1)) - mean(log2(Group2))</code></p>
<p>For volcano plots, can we use the second one?</p>
<p><a href="https://www.biostars.org/p/100460/" rel="nofollow noreferrer">https://www.biostars.org/p/100460/</a></p>

CC BY-SA 4.0
2020-08-19T05:50:46.170Z
Aren't the outputs of both calculations the same?
Reza Rezaei
CC BY-SA 4.0
2020-08-19T17:07:56.683Z
`log(x/y) = log(x) - log(y)` -> this is log math. Like @RezaRezaei says, the two calculations are the same. I guess there could be differences owing to how computers calculate the values.
Ram RS
CC BY-SA 4.0
2020-08-20T12:28:14.460Z
@RamRS Could there be a small difference due to finite precision of log transformation?
Kamil S Jaron
CC BY-SA 4.0
2020-08-20T17:42:01.780Z
@KamilSJaron I guess it could be a factor. I don't know how computers do complex math, but I'm guessing that's where the difference lies. I think for x=20, y = 5, the two log2 values should be the same. I do think that even for more complex math, precision should be maintained to the third decimal place at least, so how significant would the difference be?
Ram RS
<r>
About the log2 fold change
# About the log2 fold change

(Asked by: username_0 on 2020-08-19)

It seems that we have two calculations of log fold change:

`Actual log2(FC) = log2(mean(Group1)/mean(Group2))`

`Limma's "Log(FC)" = mean(log2(Group1)) - mean(log2(Group2))`

For volcano plots, can we use the second one?

<https://www.biostars.org/p/100460/>

**Tags:** r
> **Comments:**
> **username_1**: Aren't the outputs of both calculations the same?  
> **username_2**: `log(x/y) = log(x) - log(y)` -> this is log math. Like @RezaRezaei says, the two calculations are the same. I guess there could be differences owing to how computers calculate the values.  
> **username_3**: @RamRS Could there be a small difference due to finite precision of log transformation?  
> **username_2**: @KamilSJaron I guess it could be a factor. I don't know how computers do complex math, but I'm guessing that's where the difference lies. I think for x=20, y = 5, the two log2 values should be the same. I do think that even for more complex math, precision should be maintained to the third decimal place at least, so how significant would the difference be?  

---

## 2 answers

### Answer by username_4 on 2021-06-07. Score: 1

Yes, you can use the second one for volcano plots, but it might help to understand what it's implying.
The difference between these formulas is in the mean calculation. The following equations are identical:
log(a/b)

and
log(a) - log(b)

However, in your example, the first equation calculates the mean prior to doing the log, whereas the second example does the log first (i.e. log(mean(Group1)) vs mean(log(Group1))).
As a consequence, the equations are similar, but not identical, and that difference depends on the underlying assumptions of the expression model.
In the first equation (what you call 'Actual'), the genes are assumed to follow a normal distribution in linear space, whereas in the second equation they're assumed to follow a normal distribution in log space.
Which one of these is correct is a subject of debate. It's pretty much established that gene expression for all genes together is log-normal (or, at least, much closer to log-normal than to linear), but whether this applies at an individual gene level is less clear.
In most cases, the results will be similar when looking at individual genes, and the equations can be used interchangeably. Where they differ substantially, there will be large expression differences between genes, so it's unlikely to alter the interpretation of results.


---

### Answer by username_5 on 2020-08-20. Score: 0

You can use what limma reports for everything, including volcano plots. In the post you link to I describe in a comment why this is done in every package that I know.


---

