scpdac.pp.slice_and_bin

Contents

scpdac.pp.slice_and_bin#

scpdac.pp.slice_and_bin(adata, species, binning=50, layer_key=None)#

Subset to species-specific manual genes and bin the chosen layer.

Parameters:
  • adata (AnnData) – The input AnnData object (not modified in place).

  • species (str) – Species name ("mouse" or "human").

  • binning (int (default: 50)) – Number of bins for binning. Defaults to 50.

  • layer_key (str | None (default: None)) – Key in adata.layers to bin; if None, adata.X is used.

Return type:

AnnData

Returns:

A new AnnData with sliced genes and a "binned_data" layer.

Raises:

ValueError – If the species is not recognized.