dynamo.pl.jacobian

dynamo.pl.jacobian(adata, source_genes=None, target_genes=None, basis='umap', x=0, y=1, highlights=None, cmap='bwr', background=None, pointsize=None, figsize=6, 4, show_legend=True, frontier=True, sym_c=True, save_show_or_return='show', save_kwargs={}, **kwargs)[source]

Scatter plot with pca basis.

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.

  • basis (str) – The reduced dimension.

  • x (int (default: 0)) – The column index of the low dimensional embedding for the x-axis.

  • y (int (default: 1)) – The column index of the low dimensional embedding for the y-axis.

  • highlights (list (default: None)) – Which color group will be highlighted. if highligts is a list of lists - each list is relate to each color element.

  • cmap (string (optional, default 'Blues')) – The name of a matplotlib colormap to use for coloring or shading points. If no labels or values are passed this will be used for shading points according to density (largely only of relevance for very large datasets). If values are passed this will be used for shading according the value. Note that if theme is passed then this value will be overridden by the corresponding option of the theme.

  • background (string or None (optional, default 'None`)) – The color of the background. Usually this will be either ‘white’ or ‘black’, but any color name will work. Ideally one wants to match this appropriately to the colors being used for points etc. This is one of the things that themes handle for you. Note that if theme is passed then this value will be overridden by the corresponding option of the theme.

  • figsize (None or [float, float] (default: None)) – The width and height of each panel in the figure.

  • show_legend (bool (optional, default True)) – Whether to display a legend of the labels

  • frontier (bool (default: False)) – Whether to add the frontier. Scatter plots can be enhanced by using transparency (alpha) in order to show area of high density and multiple scatter plots can be used to delineate a frontier. See matplotlib tips & tricks cheatsheet (https://github.com/matplotlib/cheatsheets). Originally inspired by figures from scEU-seq paper: https://science.sciencemag.org/content/367/6482/1151.

  • sym_c (bool (default: False)) – Whether do you want to make the limits of continuous color to be symmetric, normally this should be used for plotting velocity, jacobian, curl, divergence or other types of data with both positive or negative values.

  • 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 plt.scatters.

Returns

  • Nothing but plots the n_source x n_targets scatter plots of low dimensional embedding of the adata object, each

  • corresponds to one element in the Jacobian matrix for all sampled cells.

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(adata)