dynamo.pl.plot_hill_function(adata, pairs_mat=None, normalize=True, n_row=1, n_col=None, figsize=(6, 4), linewidth=2, save_show_or_return='show', save_kwargs={}, **plot_kwargs)[source]

Plot the hill function curve generated by dynamo.pl.response.

  • adata (AnnData) – an AnnData object.

  • pairs_mat (Optional[ndarray]) – a matrix where each row is the gene pair and the first column is the hypothetical source or regulator while the second column represents the hypothetical target. The name in this matrix should match the name in the gene_short_name column of the adata object. If None, all gene pairs in adata.uns[“response”][“fit_curve”] would be used. Defaults to None.

  • normalize (bool) – whether to normalize the curve. Defaults to True.

  • n_row (int) – the number of subplot rows. Defaults to 1.

  • n_col (Optional[int]) – the number of subplot cols. If None, it would be calculated to show all subplots. Defaults to None.

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

  • linewidth (float) – the line width of the curve. Defaults to 2.

  • save_show_or_return (Literal['save', 'show', 'both', 'all']) – whether to save or show the figure. Could be one of “save”, “show”, “both”, or “all”. “both” and “all” have the same effect. 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”: ‘scatter’, “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 {}.

  • **plot_kwargs – any other kwargs passed to pyplot.plot.

  • ValueError – no “response” data found in adata.uns.

  • ValueError – no “fit_curve” data found in adata.uns[“response”].

  • ValueError – adata does not contain gene data specified in pairs_mat

  • ValueErrorn_col * n_row is less than the number of gene pairs.

  • ValueError – the gene specified in pairs_mat is not found in adata.uns[“response”][“fit_curve”].

  • NotImplementedError – invalid fit_type in adata.uns[“response”][“fit_curve”].

  • NotImplementedError – invalid mode in adata.uns[“response”][“fit_curve”].

Return type: