scverse / pertpy

Perturbation Analysis in the scverse ecosystem.
https://pertpy.readthedocs.io/en/latest/
MIT License
92 stars 19 forks source link

scCODA convergence issue for continous covairables #597

Open Marwansha opened 1 month ago

Marwansha commented 1 month ago

Hey, I'm experiencing issues with scCODA when analyzing the effect of a continuous covariate (like age for ex ) as opposed to a categorical ones . using continuous values yields nonsensical results, showing a credible effect on all cell types and by looking at the extended summary(below) the high-density interval for each parameter has zero width (Markov chain getting stuck.??)

image

while results from using age as categorical with CODA , or comparing with linear regression while using age as categorical or continous age covariate, all the output from those match perfectly (scCODA categorical ,or lm continour or categorical ). its just using any continuous covariate in scCODA , i tried differnt covarites too and still same issue when its continous.

I don't mind sharing the data too by email if you would like

Thanks a lot in advance

Version information


anndata 0.10.5.post1 cell2cell 0.7.3 decoupler 1.6.0 matplotlib 3.8.3 numpy 1.26.4 pandas 2.2.1 pertpy 0.6.0 plotnine 0.13.0 pydeseq2 0.4.7 scanpy 1.9.8 scikit_posthocs 0.9.0 seaborn 0.13.2 session_info 1.0.0

Python 3.9.18 (main, Aug 28 2023, 06:39:39) [GCC 9.2.0] Linux-4.18.0-477.43.1.el8_8.x86_64-x86_64-with-glibc2.28

Session information updated at 2024-05-16 17:58

johannesostner commented 1 month ago

As already discussed in the original scCODA repo (https://github.com/theislab/scCODA/issues/96), I think this is either an issue with data types/covariate normalization or a bug in the code. Unfortunately, I don't have the time atm to take an extended look at this. Could maybe someone else take this over?

Zethson commented 1 month ago

@johannesostner can't make promises yet, but maybe after the preprint I have a few people that can have a stab at this. I'll put it into our backlog.