interaction matrix

Count the number of edges that each cluster share with all the others and plot in a heatmap.

Parameters

cluster_key: str Key by which to compute neighbouhood enrichment scores.


Web view

interaction_matrix_screenshot interaction_matrix_screenshot

Python equivalent

import squidpy as sq

sq.gr.spatial_neighbors(adata)
sq.gr.interaction_matrix(adata, cluster_key="cell type")
sq.pl.interaction_matrix(adata, cluster_key="cell type")