cellcharter.pl.nhood_enrichment#
- cellcharter.pl.nhood_enrichment(adata, cluster_key, row_groups=None, col_groups=None, min_freq=None, annotate=False, transpose=False, method=None, title='Neighborhood enrichment', cmap='bwr', palette=None, cbar_kwargs=mappingproxy({}), figsize=None, dpi=None, ax=None, n_digits=2, significance=None, save=None, **kwargs)#
A modified version of squidpy’s function for plotting neighborhood enrichment.
The enrichment is computed by
cellcharter.gr.nhood_enrichment()
.- Parameters:
adata (
AnnData
) – Annotated data object.cluster_key (
str
) – Key inanndata.AnnData.obs
where clustering is stored.row_groups (
Optional
[list
[str
]] (default:None
)) – Restrict the rows to these groups. IfNone
, all groups are plotted.col_groups (
Optional
[list
[str
]] (default:None
)) – Restrict the columns to these groups. IfNone
, all groups are plotted.annotate (
bool
(default:False
)) – Whether to annotate the cells of the heatmap.method (
Optional
[str
] (default:None
)) – The linkage method to be used for dendrogram/clustering, seescipy.cluster.hierarchy.linkage()
.title (
str
|None
(default:'Neighborhood enrichment'
)) – The title of the plot.cmap (
str
(default:'bwr'
)) – Continuous colormap to use.cbar_kwargs (
Mapping
[str
,Any
] (default:mappingproxy({})
)) – Keyword arguments formatplotlib.figure.Figure.colorbar()
.palette (
Union
[str
,ListedColormap
,None
] (default:None
)) – Categorical colormap for the clusters. IfNone
, useanndata.AnnData.uns
['{cluster_key}_colors']
, if available.figsize (
Optional
[tuple
[float
,float
]] (default:None
)) – Size of the figure in inches.save (
Union
[str
,Path
,None
] (default:None
)) – Whether to save the plot.ax (
Optional
[Axes
] (default:None
)) – Axes,matplotlib.axes.Axes
.n_digits (
int
(default:2
)) – The number of digits of the number in the annotations.significance (
Optional
[float
] (default:None
)) – Mark the values that are below this threshold with a star. IfNone
, no significance is computed. It requiresgr.nhood_enrichment
to be run withpvalues=True
.kwargs (
Any
) – Keyword arguments formatplotlib.pyplot.text()
.
- Return type:
- Returns:
Nothing, just plots the figure and optionally saves the plot.