Skip to content

Commit

Permalink
Merge pull request #533 from Sichao25/debug
Browse files Browse the repository at this point in the history
remove KDEpy dependency
  • Loading branch information
Xiaojieqiu authored Jun 6, 2023
2 parents 65fd8c2 + f5e0871 commit c92abbd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 8 additions & 1 deletion dynamo/preprocessing/external/sctransform.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import statsmodels.discrete.discrete_model
import statsmodels.nonparametric.kernel_regression
from anndata import AnnData
from KDEpy import FFTKDE
from scipy import stats

from ...configuration import DKM
Expand Down Expand Up @@ -71,6 +70,10 @@ def is_outlier(
Returns:
Boolean array indicating whether each value in `y` is an outlier (`True`) or not (`False`).
"""
try:
from KDEpy import FFTKDE
except ImportError:
raise ImportError("Please install KDEpy for sctransform.")
z = FFTKDE(kernel="gaussian", bw="ISJ").fit(x)
z.evaluate()
bin_width = (max(x) - min(x)) * z.bw / 2
Expand Down Expand Up @@ -215,6 +218,10 @@ def sctransform_core(
"""
import multiprocessing
import sys
try:
from KDEpy import FFTKDE
except ImportError:
raise ImportError("Please install KDEpy for sctransform.")

main_info("sctransform adata on layer: %s" % (layer))
X = DKM.select_layer_data(adata, layer).copy()
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pandas>=1.3.5
scipy>=1.4.1
scikit-learn>=0.19.1
anndata>=0.8.0
KDEpy
loompy>=3.0.5
matplotlib>=3.5.3
setuptools
Expand Down

0 comments on commit c92abbd

Please sign in to comment.