dynamo.pl.sensitivity_kinetics

dynamo.pl.sensitivity_kinetics(adata, basis='umap', regulators=None, effectors=None, mode='pseudotime', tkey='potential', color_map='bwr', gene_order_method='raw', show_colorbar=False, cluster_row_col=(False, True), figsize=(11.5, 6), standard_scale=1, n_convolve=30, save_show_or_return='show', save_kwargs={}, **kwargs)[source]

Plot the Sensitivity dynamics over time (pseudotime or inferred real time) in a heatmap.

Note that by default potential estimated with the diffusion graph built from reconstructed vector field will be used as the measure of pseudotime.

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

  • basis (str) – the reduced dimension basis. Defaults to “umap”.

  • regulators (Optional[List[str]]) – the list of genes that will be used as regulators for plotting the Jacobian heatmap, only limited to genes that have already performed Jacobian analysis. Defaults to None.

  • effectors (Optional[List[str]]) – the list of genes that will be used as targets for plotting the Jacobian heatmap, only limited to genes that have already performed Jacobian analysis. Defaults to None.

  • mode (Literal['pseudotime', 'vector_field']) – which data mode will be used, either vector_field or pseudotime. if mode is vector_field, the trajectory predicted by vector field function will be used, otherwise pseudotime trajectory (defined by time argument) will be used. By default, potential estimated with the diffusion graph built reconstructed vector field will be used as pseudotime. Defaults to “pseudotime”.

  • tkey (str) – the .obs column that will be used for timing each cell, only used when mode is not vector_field. Defaults to “potential”.

  • color_map (str) – color map that will be used to color the gene expression. If half_max_ordering is True, the color map need to be divergent, good examples, include BrBG, RdBu_r or coolwarm, etc. Defaults to “bwr”.

  • gene_order_method (Literal['raw', 'maximum', 'half_max_ordering']) – supports two different methods for ordering genes when plotting the heatmap: either half_max_ordering, or maximum. For half_max_ordering, it will order genes into up, down and transit groups by the half max ordering algorithm (HA Pliner, et al., Molecular cell 71 (5), 858-871. e8). While for maximum, it will order by the position of the highest gene expression. Or, use raw to prevent any ordering. Defaults to “raw”.

  • show_colorbar (bool) – whether to show the color bar. Defaults to False.

  • cluster_row_col (Tuple[bool, bool]) – whether to cluster the row or columns. Defaults to (False, True).

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

  • standard_scale (int) – either 0 (rows, cells) or 1 (columns, genes). Whether to standardize that dimension, meaning for each row or column, subtract the minimum and divide each by its maximum. Defaults to 1.

  • n_convolve (int) – the number of cells for convolution. Defaults to 30.

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

  • **kwargs – any other kwargs that would be passed to heatmap(). Currently `xticklabels=False, yticklabels=’auto’ is passed to heatmap() by default.`

Raises:
Return type:

Optional[ClusterGrid]

Returns:

None would be returned by default. If save_show_or_return is set to be ‘return’, the generated seaborn ClusterGrid would be returned.

Examples

>>> import dynamo as dyn
>>> adata = dyn.sample_data.hgForebrainGlutamatergic()
>>> adata = dyn.pp.recipe_monocle(adata)
>>> dyn.tl.dynamics(adata)
>>> dyn.vf.VectorField(adata, basis='pca')
>>> valid_gene_list = adata[:, adata.var.use_for_transition].var.index[:2]
>>> dyn.vf.sensitivity(adata, regulators=valid_gene_list[0], effectors=valid_gene_list[1])
>>> dyn.pl.sensitivity_kinetics(adata)