Skip to content

Commit

Permalink
Preserve backwards compatability
Browse files Browse the repository at this point in the history
Made it so `sc.pp.downsample_counts` will still run if keyword argument "downsample_counts" is used, but will throw a deprecation warning.
  • Loading branch information
ivirshup committed Feb 18, 2019
1 parent 55a2f31 commit 91601d2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scanpy/preprocessing/_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from .. import settings as sett
from .. import logging as logg
from ..utils import sanitize_anndata
from ..utils import sanitize_anndata, deprecated_arg_names
from ._distributed import materialize_as_ndarray
from ._utils import _get_mean_var

Expand Down Expand Up @@ -899,14 +899,15 @@ def subsample(data, fraction=None, n_obs=None, random_state=0, copy=False):
return X[obs_indices], obs_indices


def downsample_counts(adata, total_counts=None, counts_per_cell=None, random_state=0,
@deprecated_arg_names({"target_counts": "counts_per_cell"})
def downsample_counts(adata, counts_per_cell=None, total_counts=None, random_state=0,
replace=False, copy=False):
"""
Downsample counts from count matrix.
If `total_counts` is specified, expression matrix will be downsampled to
contain at most `total_counts`. If `counts_per_cell` in specified, each
cell will downsampled.
If `counts_per_cell` in specified, each cell will downsampled. If
`total_counts` is specified, expression matrix will be downsampled to
contain at most `total_counts`.
Parameters
----------
Expand Down

0 comments on commit 91601d2

Please sign in to comment.