tangram.plot_utils.plot_genes

tangram.plot_utils.plot_genes(genes, adata_measured, adata_predicted, x='x', y='y', s=5, log=False, cmap='inferno', robust=False, perc=0, invert_y=True)

Utility function to plot and compare original and projected gene spatial pattern ordered by intensity of the gene signal.

Parameters
  • genes (list) – list of gene names (str).

  • adata_measured (AnnData) – ground truth gene spatial AnnData

  • adata_predicted (AnnData) – projected gene spatial AnnData, can also be adata_ge_cv AnnData returned by cross_validation under ‘loo’ mode

  • x (str) – Optional. Column name for spots x-coordinates (must be in adata_measured.var and adata_predicted.var). Default is ‘x’.

  • y (str) – Optional. Column name for spots y-coordinates (must be in adata_measured.var and adata_predicted.var). Default is ‘y’.

  • s (float) – Optional. Marker size. Default is 5.

  • log – Optional. Whether to apply the log before plotting. Default is False.

  • cmap (str) – Optional. Name of colormap. Default is ‘inferno’.

  • robust (bool) – Optional. If True, the colormap range is computed with given percentiles instead of extreme values.

  • perc (float) – Optional. percentile used to calculate colormap range, only used when robust is True. Default is zero.

  • invert_y (bool) – Optional. If invert the y axis for the plot. Default is True.

Returns

None