napari_prism.gr.cellular_neighborhoods_sq

napari_prism.gr.cellular_neighborhoods_sq#

napari_prism.gr.cellular_neighborhoods_sq(adata, phenotype, connectivity_key, k_kmeans=None, mini_batch_kmeans=True, parallelise=False)#

Compute Nolan’s cellular neighborhoods compatible with squidpy-generated .obsp spatial graphs. By default, stores the results inplace.

Parameters:
  • adata – AnnData object.

  • phenotype (str) – Cell label to compute neighborhoods on.

  • connectivity_key (str) – Key for the adjacency matrix in adata.obsp. Ideally, should be a KNN graph to stay true to the original definition of cellular neighborhoods.

  • k_kmeans (Optional[list[int]] (default: None)) – List of K values to use for KMeans clustering. If None, defaults to [10].

  • mini_batch_kmeans (bool (default: True)) – If True, uses MiniBatchKMeans instead of KMeans.

Return type:

None