Wrong log-fold change estimation?

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?

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.

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.

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”