spateo.preprocessing.aggregate ============================== .. py:module:: spateo.preprocessing.aggregate .. autoapi-nested-parse:: Aggregate buckets of AnnData object by binning. Functions --------- .. autoapisummary:: spateo.preprocessing.aggregate.bin_adata Module Contents --------------- .. py:function:: bin_adata(adata: anndata.AnnData, bin_size: int = 1, coords_key: str = 'spatial') -> anndata.AnnData Aggregate cell-based AnnData by bin size. Cells within the same bin are aggregated together into one bucket. :param adata: Input AnnData object :param bin_size: Shrinking factor to be applied to spatial coordinates; the size of this factor dictates the size of the regions that will be combined into one pseudo-cell (larger -> generally higher number of cells in each bin). :param coords_key: Key in .obsm where spatial coordinates are stored- bin coordinates will be used to update this array inplace. :returns: New AnnData object generated by this process. :rtype: adata_binned