sparrow.pl.nhood_enrichment#
- sparrow.pl.nhood_enrichment(sdata, table_layer, celltype_column='annotation', output=None)#
Plot the neighborhood enrichment across cell-type annotations.
Enrichment is shown in a hierarchically clustered heatmap. Each entry in the heatmap indicates if the corresponding cluster pair (or cell-type pair) is over-represented or over-depleted for node-node interactions in the spatial connectivity graph.
- Parameters:
sdata (
SpatialData
) – The SpatialData object containing the data for analysis.table_layer (
str
) – The table layer insdata
to visualize.celltype_column (
str
(default:'annotation'
)) – The column name in the SpatialData object’s table that specifies the cell type annotations. The default value is_ANNOTATION_KEY
.output (
Optional
[str
] (default:None
)) – If provided, the plot will be displayed and also saved to a file with the specified filename. If None, the plot will be displayed directly without saving.
- Return type:
None
- Returns:
: None
Notes
See https://www.nature.com/articles/s41592-021-01358-2 for details on the permutation-based neighborhood enrichment score.
See also
sparrow.tb.nhood_enrichment
Calculate neighborhood enrichment.