# Wrong log-fold change estimation?

**URL:** <https://discourse.scverse.org/t/wrong-log-fold-change-estimation/3696>\
**Category:** scvi-tools\
**Tags:** diff-exp\
**Created:** [June 24, 2025, 1:01pm UTC](https://discourse.scverse.org/t/wrong-log-fold-change-estimation/3696 "2025-06-24T13:01:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christos](https://avatars.discourse-cdn.com/v4/letter/c/e36b37/32.png) [@Christos](https://discourse.scverse.org/u/Christos)\
**Post date:** [June 24, 2025, 1:01pm UTC](https://discourse.scverse.org/t/wrong-log-fold-change-estimation/3696/1 "2025-06-24T13:01:03Z")

</div>

Hello, after using model.differential\_expression(), for a specific gene of interest I get the following outcome:  
proba\_de 0.9724  
proba\_not\_de 0.0276  
bayes\_factor 3.561951  
scale1 0.000764  
scale2 0.000962  
pseudocounts 0.0  
delta 0.15  
lfc\_mean 0.612965  
lfc\_median 0.933985  
lfc\_std 2.177583  
lfc\_min -5.728889  
lfc\_max 6.05063  
raw\_mean1 0.4188  
raw\_mean2 0.502647  
non\_zeros\_proportion1 0.1432  
non\_zeros\_proportion2 0.234677  
raw\_normalized\_mean1 3.688732  
raw\_normalized\_mean2 8.833171  
is\_de\_fdr\_0.05 True

How can it be that the lfc\_mean is positive (0.61), whereas the gene is clearly more expressed in the second group?

---

<div class="post-metadata">

**Author:** ![ori-kron-wis](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/ori-kron-wis/32/1099_2.png) [@ori-kron-wis](https://discourse.scverse.org/u/ori-kron-wis)\
**Post date:** [July 9, 2025, 11:55am UTC](https://discourse.scverse.org/t/wrong-log-fold-change-estimation/3696/2 "2025-07-09T11:55:37Z")

</div>

Hey,  
Remember the DE in scvi-tools approximate the LFC and its not a deterministic calculation over the raw count data, although here bayes\_factor is high and I wouldn’t expect lfc mean to be positive.

Can you share more info on what you ran? scvi-tools version, what is your model and data, and how did you run the differential\_expression function.

Some parameters to think about when running DE: mode, pseudocounts (small epsilon), delta and whether you are running group wise or index wise to compare groups of genes.

---

<div class="post-metadata">

**Author:** ![Christos](https://avatars.discourse-cdn.com/v4/letter/c/e36b37/32.png) [@Christos](https://discourse.scverse.org/u/Christos)\
**Post date:** [July 9, 2025, 12:32pm UTC](https://discourse.scverse.org/t/wrong-log-fold-change-estimation/3696/3 "2025-07-09T12:32:01Z")

</div>

Hello thanks for your reply!  
This is how I run the method:  
df=model.differential\_expression(groupby=‘NR\_pos’, group1=‘NR\_R\_post\_Non\_responder’, group2=‘NR\_NR\_post\_Non\_responder’, mode=“change”, delta=0.1,batch\_correction=True,pseudocounts=1e-7 )

Even with a simple Violin Plot we can see that the gene is more expressed in the second group.

 ![Screenshot 2025-07-09 at 15.29.52](https://canada1.discourse-cdn.com/flex035/uploads/forum11/original/2X/1/1036e35f5a3bdeb6564aa9e28560e7213ff8fe3d.png)

---

<div class="post-metadata">

**Author:** ![ori-kron-wis](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/ori-kron-wis/32/1099_2.png) [@ori-kron-wis](https://discourse.scverse.org/u/ori-kron-wis)\
**Post date:** [July 9, 2025, 12:44pm UTC](https://discourse.scverse.org/t/wrong-log-fold-change-estimation/3696/4 "2025-07-09T12:44:09Z")

</div>

Thank you. What is the results running with mode=“vanilla”, pseudocounts=0?  
Other option is to run with mode=“change”, pseudocounts=0 and test\_mode = “two”
