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.unsthat contains the LIANA results. Default is'liana_res'.- liana_res
DataFrame|None(default:None) liana_resaDataFramein liana’s format.- colour
str|None(default:None) columninliana_resto define the colours of the dots.- size
str|None(default:None) columninliana_resto 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_nentities to plot.- orderby
str|None(default:None) If
top_nis notNone, order the interactions by this column- orderby_ascending
bool|None(default:None) If
top_nis notNone, specify how to order the interactions- orderby_absolute
bool(default:False) If
top_nis notNone, whether to order by the absolute value of theorderbycolumn.- 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) listof ligand complexes to filter the interactions to be plotted. Defaults to None.- receptor_complex
str|None(default:None) listof receptor complexes to filter the interactions to be plotted. Defaults to None.- inverse_colour
bool(default:False) Whether to -log10 the
colourcolumn for plotting.Falseby default.- inverse_size
bool(default:False) Whether to -log10 the
sizecolumn for plotting.Falseby 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) boolwhether to return the fig object.
- adata
- Return type:
- Returns:
The resulting dotplot
Examples
Pass either a method’s result as
liana_res, or theadatait 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, ... )