dynamo.pl.show_fraction

dynamo.pl.show_fraction(adata, genes=None, group=None, figsize=(4, 3), save_show_or_return='show', save_kwargs={})[source]

Plot the fraction of each category of data used in the velocity estimation.

Parameters:
  • adata (AnnData) – an AnnData object.

  • genes (Optional[List[str]]) – the list of gene names from which the fraction will be calculated. Defaults to None.

  • group (Optional[str]) – the column key of adata.obs to facet the data into subplots. If None, no faceting will be used. Defaults to None.

  • figsize (Tuple[float, float]) – the size of each panel in the figure. Defaults to (4, 3).

  • save_show_or_return (Literal['save', 'show', 'return']) – whether to save, show, or return the plots. Could be one of ‘save’, ‘show’, or ‘return’. 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”: ‘show_fraction’, “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 {}.

Raises:
  • ValueErrorgenes does not contain any genes from the adata object.

  • ValueErroradata does not have proper splicing or labeling data.

Return type:

Optional[FacetGrid]

Returns:

None would be returned by default. If save_show_or_return is set to ‘return’, the generated figure (seaborn.FacetGrid) would be returned.