cellestial.dotplot#

dotplot(data: AnnData, keys: Sequence[str], group_by: str, *, threshold: float = 0, variables_name: str = 'gene', value_name: str = 'expression', color_low: str = '#e6e6e6', color_high: str = '#D2042D', fill: bool = False, sort_by: str | Sequence[str] | None = None, sort_order: Literal['ascending', 'descending'] = 'descending', percentage_key: str = 'pct_exp', mean_key: str = 'avg_exp', tooltips: Literal['none'] | Sequence[str] | FeatureSpec | None = None, interactive: bool = False, **geom_kwargs) PlotSpec#

Dotplot.

Parameters:
  • data (AnnData) – The AnnData object of the single cell data.

  • keys (Sequence[str]) – The variable keys or names to include in the dotplot.

  • group_by (str) – The key to group the data by.

  • threshold (float, default 0) – The expression threshold to consider a gene as expressed.

  • variables_name (str, default 'gene') – The name of the variable column in the long format.

  • value_name (str, default 'expression') – The name of the value column in the long format.

  • color_low (str, default '#e6e6e6') – The low color for the gradient.

  • color_high (str, default '#D2042D') – The high color for the gradient.

  • fill (bool, optional) – Whether to use fill aesthetic instead of color, by default False.

  • sort_by (str | None) – The column to sort the results by, by default None.

  • sort_order (str, default 'descending') – The sort order, either ‘ascending’ or ‘descending’.

  • percentage_key (str, default 'pct_exp') – The name of the percentage column.

  • mean_key (str, default 'avg_exp') – The name of the mean expression column.

  • tooltips ({'none'} | Sequence[str] | FeatureSpec | None, default None) – Tooltips to show when hovering over the geom. Accepts Sequence[str] or result of layer_tooltips() for more complex tooltips. Use ‘none’ to disable tooltips.

  • show_tooltips (bool, default True) – Whether to show tooltips.

  • interactive (bool, default False) – Whether to make the plot interactive.

  • **geom_kwargs (Any) – Additional keyword arguments for the geom_point layer.

Returns:

PlotSpec – Dotplot.