dynamo.pl.jacobian_heatmap¶
-
dynamo.pl.
jacobian_heatmap
(adata, cell_idx, source_genes=None, target_genes=None, figsize=7, 5, ncols=1, cmap='bwr', save_show_or_return='show', save_kwargs={}, **kwargs)[source]¶ Plot the Jacobian matrix for each cell as a heatmap.
Note that Jacobian matrix can be understood as a regulatory activity matrix between genes directly computed from the reconstructed vector fields.
- Parameters
adata (
AnnData
) – an Annodata object with Jacobian matrix estimated.source_genes (list or None (default: None)) – 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.
target_genes (List or None (default: None)) – 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.
cell_idx (int or list) – The numeric indices of the cells that you want to draw the jacobian matrix to reveal the regulatory activity.
figsize (None or [float, float] (default: None)) – The width and height of each panel in the figure.
ncols (int (default: 1)) – The number of columns for drawing the heatmaps.
cmap (str (default: bwr)) – The mapping from data values to color space. If not provided, the default will depend on whether center is set.
save_show_or_return (str {‘save’, ‘show’, ‘return’} (default: show)) – Whether to save, show or return the figure.
save_kwargs (dict (default: {})) – A dictionary that will passed to the save_fig function. By default it is an empty dictionary and the save_fig 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.
kwargs – Additional arguments passed to sns.heatmap.
- Returns
- Return type
Nothing but plots the n_cell_idx heatmaps of the corresponding Jacobian matrix for each selected cell.
Examples
>>> import dynamo as dyn >>> adata = dyn.sample_data.hgForebrainGlutamatergic() >>> adata = dyn.pp.recipe_monocle(adata) >>> dyn.tl.dynamics(adata) >>> dyn.tl.VectorField(adata, basis='pca') >>> valid_gene_list = adata[:, adata.var.use_for_velocity].var.index[:2] >>> dyn.tl.jacobian(adata, source_genes=valid_gene_list[0], target_genes=valid_gene_list[1]) >>> dyn.pl.jacobian_heatmap(adata)