theislab / scCODA

A Bayesian model for compositional single-cell data analysis
BSD 3-Clause "New" or "Revised" License
141 stars 23 forks source link

Final Parameter and log2-fold change have different signs #84

Closed PauBadiaM closed 10 months ago

PauBadiaM commented 10 months ago

Hi @johannesostner @Zethson,

I was running sccoda with my data and found that the Final Parameter of cell type B, even though is positive, it has a strong negative log2-fold change, as seen here:

Compositional Analysis summary:

Data: 12 samples, 4 cell types
Reference index: 3
Formula: ltype

Intercepts:
           Final Parameter  Expected Sample
Cell Type                                  
A                    1.244      1468.162015
B                    1.104      1276.358738
C                  -10.075         0.017824
D                    0.010       427.419757

Effects:
                       Final Parameter  Expected Sample  log2-fold change
Covariate   Cell Type                                                    
ltype[T.CI] A                 0.000000     1.026578e-21        -80.242443
            B                 0.399589     1.330853e-21        -79.665957
            C                67.709161     3.171958e+03         17.441228
            D                 0.000000     2.988632e-22        -80.242443

How would you interpret this result? That it is increasing or decreasing? Would it make sense to use sccoda only for checking credibility (True/False) and then just manually check the mean/median change in proportion between groups to know the sign? Sorry for asking so many questions, thank you for your time!

Zethson commented 10 months ago

Did you want to open this at https://github.com/theislab/pertpy ? Did you use the OG scCODA or the pertpy implementation?

PauBadiaM commented 10 months ago

For now I was using the OG implementation, but I could switch to pertpy if needed

Zethson commented 10 months ago

This implementation here is deprecated. Could you please try the pertpy implementation and then open the issue there if it persists?

PauBadiaM commented 10 months ago

Will try it with pertpy then ;) Closing this and will report back if needed

PauBadiaM commented 10 months ago

Just tested with pertpy, not only the issue is solved but it also runs FAST, thanks!

Zethson commented 10 months ago

All thanks to @johannesostner who is simply amazing. Happy to hear!