simba.tl.discretize

simba.tl.discretize(adata, layer=None, n_bins=5, max_bins=100)[source]

Discretize continous values

Parameters:
  • adata (AnnData) – Annotated data matrix.

  • layer (str, optional (default: None)) – The layer used to perform discretization

  • n_bins (int, optional (default: 5)) – The number of bins to produce. It must be smaller than max_bins.

  • max_bins (int, optional (default: 100)) – The number of bins used in the initial approximation. i.e. the number of bins to cluster.

Returns:

  • updates adata with the following fields

  • `.layer[‘simba’]` (array_like) – The matrix of discretized values to build SIMBA graph.

  • `.uns[‘disc’]` (dict) – bin_edges: The edges of each bin. bin_count: The number of values in each bin. hist_edges: The edges of each bin in the initial approximation. hist_count: The number of values in each bin for the initial approximation.