liana.pl.dotplot

Contents

liana.pl.dotplot#

liana.pl.dotplot(adata=None, uns_key='liana_res', liana_res=None, colour=None, size=None, source_labels=None, target_labels=None, top_n=None, orderby=None, orderby_ascending=None, orderby_absolute=False, filter_fn=None, ligand_complex=None, receptor_complex=None, inverse_colour=False, inverse_size=False, cmap='viridis', size_range=(2, 9), figure_size=(8, 6), return_fig=True)#

Dotplot interactions by source and target cells

Parameters:
adata AnnData | None (default: None)

Annotated data object.

uns_key str (default: 'liana_res')

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.

colour str | None (default: None)

column in liana_res to define the colours of the dots.

size str | None (default: None)

column in liana_res to define the size of the dots.

source_labels list[str] | None (default: None)

List of labels to use as source, the rest are filtered out.

target_labels list[str] | None (default: None)

List of labels to use as target, the rest are filtered out.

top_n int | None (default: None)

top_n entities to plot.

orderby str | None (default: None)

If top_n is not None, order the interactions by this column

orderby_ascending bool | None (default: None)

If top_n is not None, specify how to order the interactions

orderby_absolute bool (default: False)

If top_n is not None, whether to order by the absolute value of the orderby column.

filter_fn Callable[[Series], bool] | None (default: None)

A function, applied along the columns (axis=1), used to filter the results to be plotted.

ligand_complex str | None (default: None)

list of ligand complexes to filter the interactions to be plotted. Defaults to None.

receptor_complex str | None (default: None)

list of receptor complexes to filter the interactions to be plotted. Defaults to None.

inverse_colour bool (default: False)

Whether to -log10 the colour column for plotting. False by default.

inverse_size bool (default: False)

Whether to -log10 the size column for plotting. False by default.

cmap str (default: 'viridis')

Colour map to use for plotting.

size_range tuple[float, float] (default: (2, 9))

Define size range. Tuple of (min, max) integers.

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

Figure x,y size

return_fig bool (default: True)

bool whether to return the fig object.

Return type:

plotnine.ggplot | None

Returns:

The resulting dotplot

Examples

Pass either a method’s result as liana_res, or the adata it was written to:

>>> import liana as li
>>> adata = li.ds.generate_toy_adata()
>>> li.mt.rank_aggregate(adata, groupby="bulk_labels", n_perms=None)
>>> p = li.pl.dotplot(
...     adata,
...     colour="lr_means",
...     size="magnitude_rank",
...     inverse_size=True,
...     top_n=10,
...     orderby="magnitude_rank",
...     orderby_ascending=True,
... )