Skip to content

Commit

Permalink
Merge pull request #16 from Intron7/v0.5.1
Browse files Browse the repository at this point in the history
v0.5.1
  • Loading branch information
Intron7 authored Feb 27, 2023
2 parents 96d8f00 + 5cda5d1 commit 229bb90
Show file tree
Hide file tree
Showing 15 changed files with 1,464 additions and 2,317 deletions.
2 changes: 1 addition & 1 deletion conda/rsc_rapids_22.12.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: rapids_singlecell_0.5.0
name: rapids_singlecell
channels:
- rapidsai
- nvidia
Expand Down
2 changes: 1 addition & 1 deletion conda/rsc_rapids_23.02.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: rapids_singlecell_0.5.0
name: rapids_singlecell
channels:
- rapidsai
- nvidia
Expand Down
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import rapids_singlecell as rsc
.. autosummary::
:toctree: generated/
pp.calculate_qc
pp.calculate_qc_metrics
pp.filter_cells
pp.filter_genes
pp.normalize_total
Expand Down
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

info = metadata("rapids_singlecell")
project_name = "rapids-singlecell"
project = "rapids-singlecell"
title = "accelerating single cell analysis"
author = info["Author"]
copyright = f"{datetime.now():%Y}, {author}."
version = info["Version"]
Expand Down
286 changes: 104 additions & 182 deletions docs/notebooks/demo_gpu-PR.ipynb

Large diffs are not rendered by default.

284 changes: 130 additions & 154 deletions docs/notebooks/demo_gpu-seuratv3-brain.ipynb

Large diffs are not rendered by default.

620 changes: 229 additions & 391 deletions docs/notebooks/demo_gpu-seuratv3.ipynb

Large diffs are not rendered by default.

498 changes: 156 additions & 342 deletions docs/notebooks/demo_gpu.ipynb

Large diffs are not rendered by default.

297 changes: 104 additions & 193 deletions notebooks/demo_gpu-PR.ipynb

Large diffs are not rendered by default.

298 changes: 127 additions & 171 deletions notebooks/demo_gpu-seuratv3-brain.ipynb

Large diffs are not rendered by default.

614 changes: 226 additions & 388 deletions notebooks/demo_gpu-seuratv3.ipynb

Large diffs are not rendered by default.

502 changes: 159 additions & 343 deletions notebooks/demo_gpu.ipynb

Large diffs are not rendered by default.

26 changes: 12 additions & 14 deletions rapids_singlecell/cunnData/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(
if adata:
if not issparse_cpu(adata.X):
inter = scipy.sparse.csr_matrix(adata.X)
self.X = cp.sparse.csr_matrix(inter, dtype=cp.float32)
self._X = cp.sparse.csr_matrix(inter, dtype=cp.float32)
del inter
else:
self._X = cp.sparse.csr_matrix(adata.X, dtype=cp.float32)
Expand Down Expand Up @@ -318,29 +318,27 @@ def _sanitize(self):

def __getitem__(self, index):
obs_dx,var_dx = _normalize_indices(index, self.obs_names, self.var_names)
self.X = self.X[obs_dx,var_dx]
cudata = cunnData(X =self.X[obs_dx,var_dx].copy(),
obs = self.obs.iloc[obs_dx,:].copy(),
var = self.var.iloc[var_dx,:].copy(),
uns=self.uns)

if self.layers:
for key, matrix in self.layers.items():
self.layers[key] = matrix[obs_dx, var_dx]
cudata.layers[key] = matrix[obs_dx, var_dx].copy()
if self.obsm:
for key, matrix in self.obsm.items():
if isinstance(matrix, pd.DataFrame):
self.obsm[key] = matrix.iloc[obs_dx, :]
cudata.obsm[key] = matrix.iloc[obs_dx, :].copy()
else:
self.obsm[key] = matrix[obs_dx, :]
cudata.obsm[key] = matrix[obs_dx, :].copy()
if self.varm:
for key, matrix in self.varm.items():
if isinstance(matrix, pd.DataFrame):
self.varm[key] = matrix.iloc[var_dx, :]
cudata.varm[key] = matrix.iloc[var_dx, :].copy()
else:
self.varm[key] = matrix[var_dx, :]
return(cunnData(X = self.X,
obs = self.obs.iloc[obs_dx,:],
var = self.var.iloc[var_dx,:],
uns=self.uns,
layers= self.layers,
obsm= self.obsm,
varm= self.varm))
cudata.varm[key] = matrix[var_dx, :].copy()
return(cudata)

def _gen_repr(self, n_obs, n_vars) -> str:
descr = f"cunnData object with n_obs × n_vars = {n_obs} × {n_vars}"
Expand Down
2 changes: 1 addition & 1 deletion rapids_singlecell/cunnData_funcs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
from ._hvg import highly_variable_genes
from ._normalize import normalize_pearson_residuals, log1p, normalize_total
from ._simple import filter_cells, filter_genes, filter_highly_variable
from ._simple import calc_gene_qc, calculate_qc, flag_gene_family
from ._simple import calc_gene_qc, calculate_qc_metrics, flag_gene_family
Loading

0 comments on commit 229bb90

Please sign in to comment.