milopy icon indicating copy to clipboard operation
milopy copied to clipboard

Native python implementation for NB-GLM instead of `edgeR`

Open emdann opened this issue 3 years ago • 9 comments

Gathering some suggestions:

  • Patsy for model matrix encoding https://patsy.readthedocs.io/en/latest/overview.html
  • GLM implementation in pymc3 https://docs.pymc.io/notebooks/GLM-poisson-regression.html

emdann avatar May 14 '21 12:05 emdann

statsmodels https://www.statsmodels.org/stable/generated/statsmodels.formula.api.negativebinomial.html#statsmodels.formula.api.negativebinomial

emdann avatar Aug 31 '21 14:08 emdann

tensorflow might be useful for GLMs: https://www.tensorflow.org/probability/examples/Generalized_Linear_Models I've not tested/used this, but it gives a stable API.

MikeDMorgan avatar Sep 03 '21 08:09 MikeDMorgan

batchGLM / diffxpy from theislab

emdann avatar Oct 08 '21 18:10 emdann

Theislab dude here. Just wanted to say that we have some people working on batchGLM again and I think that it would be a good choice for you in the future.

Zethson avatar Feb 17 '22 19:02 Zethson

Hi @Zethson, thanks for the heads up. I actually have some bandwidth now to look into this and try a few options out.

emdann avatar Feb 18 '22 08:02 emdann

Hi @Zethson, thanks for the heads up. I actually have some bandwidth now to look into this and try a few options out.

Well, batchglm will still take a few months to be usable and well documented, but feel free to take a look nevertheless :) (development is happening on a couple of branches so don't look at master).

Zethson avatar Feb 18 '22 08:02 Zethson

Hi @Zethson, thanks for the heads up. I actually have some bandwidth now to look into this and try a few options out.

Well, batchglm will still take a few months to be usable and well documented, but feel free to take a look nevertheless :) (development is happening on a couple of branches so don't look at master).

batchglm developer here with a minor update on this for @emdann and @Zethson: The python port of edgeR using batchglm as backend is implemented for your purposes but I didn't have the time for testing / deployment yet. It's probably going to take till January until I find time for that but let me just say that for my small testing dataset it is already pretty much exactly reproducing edgeR's results.

picciama avatar Nov 07 '22 12:11 picciama

Excellent @picciama ! Thank you very much! Really think that a Python native edgeR will be super useful for the community. Just a big bonus that we can add this to Milopy.

CC @ivirshup

Zethson avatar Nov 07 '22 12:11 Zethson

BTW @picciama this is where the new batchGLM based implementation should then end up in -> https://github.com/theislab/pertpy/blob/development/pertpy/tools/_milopy.py#L306 (Just another if case)

Zethson avatar Nov 07 '22 12:11 Zethson