liana.pl.lric_lineplot

Contents

liana.pl.lric_lineplot#

liana.pl.lric_lineplot(adata=None, uns_key='lric', liana_res=None, interaction=None, source=None, target=None, max_dist=None, figure_size=(6, 4), return_fig=True)#

Plot the g(r) profile of a single interaction from lric / cross_pcf.

g(r) is the observed count at radius r relative to the closed-form random-labelling null; g(r) > 1 is co-enrichment, < 1 depletion, and the dashed line at 1 marks the null. For pairwise LRIC the full coupling is decomposed into its architecture-only (g_pcf) and expression-only (g_expr) components, drawn as separate lines.

Parameters:
adata AnnData | None (default: None)

Annotated data object. Its .uns[uns_key] holds the result. Mutually exclusive with liana_res.

uns_key str (default: 'lric')

Key in adata.uns that contains the LIANA results. Default is 'liana_res'.

liana_res DataFrame | None (default: None)

liana_res a DataFrame in liana’s format.

A lric / cross_pcf result, used when adata is None.

interaction str | None (default: None)

The interaction to plot – "source^target" for cross_pcf, "ligand^receptor" for lric.

source str | None (default: None)

Sender cell type; only for results that carry a source column.

target str | None (default: None)

Receiver cell type; only for results that carry a target column.

max_dist float | None (default: None)

Plot only radii r < max_dist; None uses all radii.

figure_size tuple[float, float] (default: (6, 4))

Figure x,y size

return_fig bool (default: True)

bool whether to return the fig object.

Return type:

plotnine.ggplot | None

Returns:

A plotnine.ggplot if return_fig else None (draws the plot).