Skip to content

a statsmodels implement based on PyTorch, can perform single-cell differential expression analysis 1000X faster than R package.

Notifications You must be signed in to change notification settings

hanruijiang/scpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Scpy

a statsmodels implement based on pytorch

can perform single-cell gene differential expression analysis 1000X faster than R package.

requirements

  • pandas
  • statsmodels
  • torch

usage

basic

import scpy

scpy.fit(x, y, family='poisson', device='cpu', **kwargs)

scpy.fit_batch(X, Y, family='negative_binomial', device='cpu', **kwargs)

Support specifying method, maxiter and other parameters in statsmodels optimizers

parallel

python -m scpy demo.py demo.csv -d 0,1,2,3,4,5,6,7

demo.py

args = {
 'X': X,
 'Y': Y,
 'family': 'negative_binomial',
 'xnames': xnames,
 'yname': yname,
 'kwargs': {}
}

todo

  • Currently only supports 'poisson' and 'negative_binomial', add more distributions.
  • Fix bug on Hessian matrix inversion.
  • Automatically cache x and y in fit_batch.

About

a statsmodels implement based on PyTorch, can perform single-cell differential expression analysis 1000X faster than R package.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published