harpy.tb.nhood_enrichment#
- harpy.tb.nhood_enrichment(sdata, labels_name, table_name, output_table_name, celltype_column='annotation', seed=0, overwrite=False)#
Calculate the nhood enrichment using squidpy via
squidpy.gr.spatial_neighbors()andsquidpy.gr.nhood_enrichment().- Parameters:
sdata (
SpatialData) – Inputspatialdata.SpatialDataobject containing spatial data.labels_name (
list[str]) – The labels element(s) ofsdataused to select the cells via the region key insdata.tables[table_name].obs. Note that ifoutput_table_nameis equal totable_nameand overwrite is True, cells insdata.tables[table_name]linked to otherlabels_name(via the region key), will be removed fromsdata.tables[table_name](also from the backing zarr store if it is backed).table_name (
str) – The table element insdata.output_table_name (
str) – The output table element insdata.celltype_column (
str(default:'annotation')) – This will be passed tocluster_keyofsquidpy.gr.nhood_enrichment().seed (
int(default:0)) – seedoverwrite (
bool(default:False)) – If True, overwrites theoutput_table_nameif it already exists insdata.
- Return type:
- Returns:
: The updated
spatialdata.SpatialDataobject.