squidpy.pl.ligrec
- squidpy.pl.ligrec(adata, cluster_key=None, source_groups=None, target_groups=None, means_range=(-inf, inf), pvalue_threshold=1.0, remove_empty_interactions=True, remove_nonsig_interactions=False, dendrogram=None, alpha=0.001, swap_axes=False, title=None, figsize=None, dpi=None, save=None, **kwargs)[source]
Plot the result of a receptor-ligand permutation test.
The result was computed by
squidpy.gr.ligrec().\(molecule_1\) belongs to the source clusters displayed on the top (or on the right, if
swap_axes = True, whereas \(molecule_2\) belongs to the target clusters.- Parameters:
adata (
AnnData|Mapping[str,DataFrame]) – Annotated data object. It can also be adict, as returned bysquidpy.gr.ligrec().cluster_key (
str|None) – Key inanndata.AnnData.obswhere clustering is stored. Only used whenadatais of typeAnnData.source_groups (
str|Sequence[str] |None) – Source interaction clusters. If None, select all clusters.target_groups (
str|Sequence[str] |None) – Target interaction clusters. If None, select all clusters.means_range (
tuple[float,float]) – Only show interactions whose means are within this closed interval.pvalue_threshold (
float) – Only show interactions with p-value <=pvalue_threshold.remove_empty_interactions (
bool) – Remove rows and columns that only contain interactions with NaN values.remove_nonsig_interactions (
bool) – Remove rows and columns that only contain interactions that are larger thanalpha.How to cluster based on the p-values. Valid options are:
None - do not perform clustering.
’interacting_molecules’ - cluster the interacting molecules.
’interacting_clusters’ - cluster the interacting clusters.
’both’ - cluster both rows and columns. Note that in this case, the dendrogram is not shown.
alpha (
float|None) – Significance threshold. All elements with p-values <=alphawill be marked by tori instead of dots.swap_axes (
bool) – Whether to show the cluster combinations as rows and the interacting pairs as columns.figsize (
tuple[float,float] |None) – Size of the figure in inches.scalebar_kwargs – Keyword arguments for
matplotlib_scalebar.ScaleBar.edges_kwargs – Keyword arguments for
networkx.drawing.nx_pylab.draw_networkx_edges().kwargs (
Any) – Keyword arguments formatplotlib.pyplot.scatter()ormatplotlib.pyplot.imshow().kwargs – Keyword arguments for
scanpy.pl.DotPlot.style()orscanpy.pl.DotPlot.legend().
- Return type:
- Returns:
Nothing, just plots the figure and optionally saves the plot.