loki.decompose.cell_type_decompose
- loki.decompose.cell_type_decompose(sc_ad, st_ad, cell_type_col='cell_type', NMS_mode=False, major_types=None, min_percentile=5, max_percentile=95)
Performs cell type decomposition on spatial data (ST or image) with single-cell data .
- Parameters:
sc_ad – AnnData object containing single-cell meta data.
st_ad – AnnData object containing spatial data (ST or image) meta data.
cell_type_col – The column name in sc_ad.obs that contains cell type annotations. Default is ‘cell_type’.
NMS_mode – Boolean flag to apply Non-Maximum Suppression (NMS) mode. Default is False.
major_types – Major cell types used for NMS mode. Default is None.
min_percentile – The lower percentile used for clipping (defaults to 5).
max_percentile – The upper percentile used for clipping (defaults to 95).
- Returns:
The spatial AnnData object with projected cell type annotations.