From d6a7c403ea5ae28ea659bed585c377ffd4238594 Mon Sep 17 00:00:00 2001 From: Severin Dicks <37635888+Intron7@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:02:01 +0200 Subject: [PATCH 1/5] Update cunnData.py --- rapids_singlecell/cunnData.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rapids_singlecell/cunnData.py b/rapids_singlecell/cunnData.py index e059fe47..e60b7021 100755 --- a/rapids_singlecell/cunnData.py +++ b/rapids_singlecell/cunnData.py @@ -536,6 +536,7 @@ def normalize_pearson_residuals(self, X = X - mu X = X / cp.sqrt( mu + mu**2 / theta) X = cp.clip(X, a_min=-clip, a_max=clip) + X = cp.array(X, dtype= cp.float32) if inplace == True: if layer: self.layers[layer]= X @@ -1433,4 +1434,4 @@ def _check_nonnegative_integers(X): elif cp.any(~cp.equal(cp.mod(data, 1), 0)): return False else: - return True \ No newline at end of file + return True From bb5406393b1cf43bfc5bd54e29e15d8c5e6098bb Mon Sep 17 00:00:00 2001 From: Severin Dicks <37635888+Intron7@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:05:19 +0200 Subject: [PATCH 2/5] Update scanpy_gpu_funcs.py --- rapids_singlecell/scanpy_gpu_funcs.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rapids_singlecell/scanpy_gpu_funcs.py b/rapids_singlecell/scanpy_gpu_funcs.py index c384d9bb..7a2bd81b 100755 --- a/rapids_singlecell/scanpy_gpu_funcs.py +++ b/rapids_singlecell/scanpy_gpu_funcs.py @@ -22,6 +22,8 @@ from cuml.cluster import KMeans from cuml.decomposition import PCA +from scipy.sparse import issparse +import warnings def _select_groups(labels, groups_order_subset='all'): @@ -345,6 +347,11 @@ def pca(adata: AnnData, covariance matrix. """ X = adata.layers[layer] if layer is not None else adata.X + if issparse(X): + warnings.warn( + "Your Countmatrix seems to be sparse, this can lead to a massive performance penalty.", + UserWarning, + ) pca_func = PCA(n_components=n_comps, output_type="numpy") adata.obsm["X_pca"] = pca_func.fit_transform(X) adata.uns['pca'] ={'variance':pca_func.explained_variance_, 'variance_ratio':pca_func.explained_variance_ratio_} @@ -907,4 +914,4 @@ def harmony_integrate( from . import harmonpy_gpu harmony_out = harmonpy_gpu.run_harmony(adata.obsm[basis], adata.obs, key, **kwargs) - adata.obsm[adjusted_basis] = harmony_out.Z_corr.T.get() \ No newline at end of file + adata.obsm[adjusted_basis] = harmony_out.Z_corr.T.get() From 46edc43d01dcde35016eaf761dd21cd1a770f303 Mon Sep 17 00:00:00 2001 From: Severin Dicks <37635888+Intron7@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:05:41 +0200 Subject: [PATCH 3/5] Update __init__.py --- rapids_singlecell/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rapids_singlecell/__init__.py b/rapids_singlecell/__init__.py index 3983a6cf..172efc43 100755 --- a/rapids_singlecell/__init__.py +++ b/rapids_singlecell/__init__.py @@ -1,4 +1,4 @@ from . import cunnData from . import scanpy_gpu_funcs -__version__ = '0.2.1' \ No newline at end of file +__version__ = '0.2.2' From 23ee2dd753408ec10f9e5d3b63303819099a2cf7 Mon Sep 17 00:00:00 2001 From: Severin Dicks <37635888+Intron7@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:20:43 +0200 Subject: [PATCH 4/5] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e7b9b8f4..ca114678 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ The functions are analogous versions of functions that can be found within [scan ## Requirements -To run the code in this repository you need a conda environment with rapids and scanpy installed. To use the full functionality of this repo please use `rapids-22.04` or `rapids-22.06`. You also need an Nvidia GPU. +To run the code in this repository you need a conda environment with rapids and scanpy installed. To use the full functionality of this repo please use `rapids-22.08`. You also need an Nvidia GPU. ``` conda create -n rapids_singelcell -f conda/rapids_singecell.yml conda activate rapids_singelcell @@ -14,11 +14,13 @@ ipython kernel install --user --name=rapids_singelcell ``` After you set up the enviroment you can install this package from this wheel into the enviroment. The wheel doesn't install any dependencies ``` -pip install https://github.com/Intron7/rapids_singlecell/releases/download/v0.2.1/rapids_singlecell-0.2.1-py3-none-any.whl +pip install https://github.com/Intron7/rapids_singlecell/releases/download/v0.2.2/rapids_singlecell-0.2.2-py3-none-any.whl ``` With this enviroment, you should be able to run the notebooks. So far I have tested these Notebooks on an A100 80GB, a Quadro RTX 6000 and a RTX 3090. +To view a full guide how to set up a fully functioned single cell GPU accelerated visit [GPU_SingleCell_Setup](https://github.com/Intron7/GPU_SingleCell_Setup) + ## Citation If you use this code, please cite: [![DOI](https://zenodo.org/badge/364573913.svg)](https://zenodo.org/badge/latestdoi/364573913) From fa2b10ee87eace21067e413b5aa752c18bcb7041 Mon Sep 17 00:00:00 2001 From: Severin Dicks <37635888+Intron7@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:21:23 +0200 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ca114678..14c72363 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ pip install https://github.com/Intron7/rapids_singlecell/releases/download/v0.2. With this enviroment, you should be able to run the notebooks. So far I have tested these Notebooks on an A100 80GB, a Quadro RTX 6000 and a RTX 3090. -To view a full guide how to set up a fully functioned single cell GPU accelerated visit [GPU_SingleCell_Setup](https://github.com/Intron7/GPU_SingleCell_Setup) +To view a full guide how to set up a fully functioned single cell GPU accelerated conda environment visit [GPU_SingleCell_Setup](https://github.com/Intron7/GPU_SingleCell_Setup) ## Citation