In which direction is the LCF calculated when using the function differential_expression?

I am sorry if this sounds like a stupid question, but I looked around and I could not find a proper answer.

Given idx1, idx2 as parameters to my my model.differential_expression, if I find that for a given gene the LFC is positive, does it mean that it is over expressed in idx1 or idx2?

In this tutorial it is stated that

Positive values of the LFC signify that the gene is upregulated in idx1.

However, looking in the documentation it is reported that the LFC is equal to log(B) - log(A) with idx1 indicated as A and idx2indicated as B. Following, I attach the corresponding pictures for clarity:


So, which one is correct? Looking at my data, it seems to that the second option (B over A, i.e. idx2 / idx1 it’s what is actually happening, buy I am not sure and I could not grasp it from the code.

Thank you in advance for any help.

Hey,
The scvi-tools code base is calculating idx1 over idx2,
see: model.base._differential.py

I agree the doc needs to be other way around.

However LFC is a symmetrical metric, so it doesn’t really matter how you use that as long as you keep it consist. Usually one set the idx1 group as the one represent the phenomena class (like cases, or effect) and the idx2 group represent the controls/no-effect.