scpdac.pp.bin_data#
- scpdac.pp.bin_data(adata, n_bins=50, layer=None)#
Discretize expression values into
n_binsper-cell quantile bins.Thin, user-facing wrapper around the internal
_bin_dataroutine. Safely handles dense arrays and sparse (csr/csc) matrices. The binned matrix is written toadata.layers["binned_data"]and bin edges toadata.obsm["bin_edges"].- Parameters:
- Return type:
- Returns:
The same
adata, with the binned layer attached (returned for chaining).