dynamo.pl.exp_by_groups

dynamo.pl.exp_by_groups(adata, genes, layer=None, group=None, use_ratio=False, use_smoothed=True, log=True, angle=0, re_order=True, figsize=(4, 3), save_show_or_return='show', save_kwargs={})[source]

Plot the (labeled) expression values of genes across different groups (time points).

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

  • genes (List[str]) – the list of genes that you want to plot the gene expression.

  • layer (Optional[str]) – the layer key containing the expression data. If None, the layer used would be inferred automatically. Defaults to None.

  • group (Optional[str]) – the key of group information in adata.obs that will be plotted against to. If None, no groups will be used. Normally you should supply the column that indicates the time related to the labeling experiment. For example, it can be either the labeling time for a kinetic experiment or the chase time for a degradation experiment. Defaults to None.

  • use_ratio (bool) – whether to plot the fraction of expression (for example NTR, new to total ratio) over groups. Defaults to False.

  • use_smoothed (bool) – whether to use the smoothed data as gene expression. Defaults to True.

  • log (bool) – whether to log1p transform the expression data. Defaults to True.

  • angle (int) – the angle to rotate the xtick labels for the purpose of avoiding overlapping between text. Defaults to 0.

  • re_order (bool) – whether to reorder categories before drawing groups on the x-axis. Defaults to True.

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

  • save_show_or_return (Literal['save', 'show', 'return']) – whether to save, show, or return the generated figure. Can 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”: ‘exp_by_groups’, “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:
Return type:

Optional[FacetGrid]

Returns:

None would be returned by default. If save_show_or_return is set to be ‘return’, the FacetGrid with violin plot generated with seaborn would be returned.