dynamo.pl.fate_bias

dynamo.pl.fate_bias(adata, group, basis='umap', fate_bias_df=None, figsize=(6, 4), save_show_or_return='show', save_kwargs={}, **cluster_maps_kwargs)[source]

Plot the lineage (fate) bias of cells states whose vector field trajectories are predicted.

This function internally calls dyn.tl.fate_bias to calculate fate bias dataframe. You can also visualize the data frame via pandas stlying (https://pandas.pydata.org/pandas-docs/stable/user_guide/style.html), for example:

>>> df = dyn.vf.fate_bias(adata)
>>> df.style.background_gradient(cmap='viridis')
Parameters:
  • adata (AnnData) – the AnnData object that contains the predicted fate trajectories in the uns attribute.

  • group (str) – the column key that corresponds to the cell type or other group information for quantifying the bias of cell state.

  • basis (str) – the embedding data space that cell fates were predicted and cell fates will be quantified. Defaults to “umap”.

  • fate_bias_df (Optional[DataFrame]) – the DataFrame that stores the fate bias information. If None, it would be calculated via fate_bias_df = dyn.tl.fate_bias(adata). Defaults to None.

  • figsize (Tuple[float, float]) – the size of the figure. Defaults to (6, 4).

  • save_show_or_return (Literal['save', 'show', 'return']) – whether to save, show or return the figure. Defaults to “show”.

  • save_kwargs (Dict[str, Any]) –

    a dictionary that will be passed to the save_show_ret function. By default, it is an empty dictionary and the save_show_ret function will use the

    {

    “path”: None, “prefix”: ‘phase_portraits’, “dpi”: None, “ext”: ‘pdf’, “transparent”: True, “close”: True, “verbose”: True

    }

    as its parameters. Otherwise, you can provide a dictionary that properly modify those keys according to your needs. Defaults to {}.

  • **cluster_map_kwargs – any other kwargs to be passed to seaborn.clustermap.

Return type:

Optional[Axes]

Returns:

None would be returned by default and the heatmap showing the fate bias of each cell state to each of the cell

group would be shown. If save_show_or_return is set to be return, the matplotlib axis of the plot would be returned.