Plotting Functions#

easy_vitessce.configure_plots.configure_plots(disable_plots=None, enable_plots=None)[source]#

Deactivates and reactivates interactive Vitessce plots.

Parameters:
  • disable_plots (list[str]) – List of plots.

  • enable_plots (list[str]) – List of plots.

easy_vitessce.configure_plots.diffmap(adata, **kwargs)[source]#

Creates interactive Diffusion Map plot.

Parameters:
  • adata (AnnData) – AnnData object.

  • color (str) – Gene or category group.

  • color_map (str) – Color map (viridis, plasma, jet).

  • size ((float or int)) – Size of dots.

Returns:

Vitessce widget. Documentation can be found here.

easy_vitessce.configure_plots.disable_plots(plots=None)[source]#

Deactivates interactive Vitessce plots.

Parameters:

plots (list[str]) – List of plots to disable. If None, disables all plots.

easy_vitessce.configure_plots.dotplot(adata, var_names, groupby, *, expression_cutoff=None, title=None, gene_symbols=None, layer=None, cmap=False, swap_axes=False, **kwargs)[source]#

Creates interactive dotplot.

Parameters:
  • adata (AnnData) – AnnData object.

  • groupby (str) – Category group.

  • var_names (list[str]) – List of genes.

Returns:

Vitessce widget. Documentation can be found here.

easy_vitessce.configure_plots.embedding(adata, basis, *, color=None, gene_symbols=None, layer=None, color_map=None, size=None, vmin=None, vmax=None, title=None, ncols=4, **kwargs)[source]#

Creates interactive versions of UMAP, PCA, t-SNE plots.

Parameters:
  • adata (AnnData) – AnnData object.

  • basis (str) – Name of plot (umap, pca, or tsne).

  • color (str) – Gene or categorical label.

  • color_map (str) – Color map (viridis, plasma, jet). Defaults to viridis.

  • size ((float or int)) – Size of dots.

Returns:

Vitessce widget. Documentation can be found here.

easy_vitessce.configure_plots.enable_plots(plots=None)[source]#

Activates interactive Vitessce plots.

Parameters:

plots (list[str]) – List of plots to enable. If None, enables all plots.

easy_vitessce.configure_plots.heatmap(adata, var_names, groupby, *, gene_symbols=None, layer=None, swap_axes=False, vmin=None, vmax=None, **kwargs)[source]#

Creates interactive heatmap.

Parameters:
  • adata (AnnData) – AnnData object.

  • groupby (str) – Category group.

  • var_names (list[str]) – List of genes.

  • color_map (str) – Color map (viridis, plasma, jet). Defaults to viridis.

Returns:

Vitessce widget. Documentation can be found here.

easy_vitessce.configure_plots.pca(adata, **kwargs)[source]#

Creates interactive PCA plot.

Parameters:
  • adata (AnnData) – AnnData object.

  • color (str) – Gene or category group.

  • color_map (str) – Color map (viridis, plasma, jet).

  • size ((float or int)) – Size of dots.

Returns:

Vitessce widget. Documentation can be found here.

easy_vitessce.configure_plots.spatial(adata, **kwargs)[source]#

This plotting function is deprecated since Scanpy version 1.11.0.

Parameters:
  • adata (AnnData) – AnnData object.

  • color (str) – Gene.

  • color_map (str) – Color map (viridis, plasma, jet). Defaults to viridis.

Returns:

Vitessce widget. Documentation can be found here.

easy_vitessce.configure_plots.tsne(adata, **kwargs)[source]#

Creates interactive t-SNE plot.

Parameters:
  • adata (AnnData) – AnnData object.

  • color (str) – Gene or category group.

  • color_map (str) – Color map (viridis, plasma, jet).

  • size ((float or int)) – Size of dots.

Returns:

Vitessce widget. Documentation can be found here.

easy_vitessce.configure_plots.umap(adata, **kwargs)[source]#

Creates interactive UMAP plot.

Parameters:
  • adata (AnnData) – AnnData object.

  • color (str) – Gene or category group.

  • color_map (str) – Color map (viridis, plasma, jet).

  • size (float or int) – Size of dots.

Returns:

Vitessce widget. Documentation can be found here.

easy_vitessce.configure_plots.violin(adata, keys, groupby, *, log=False, stripplot=True, jitter=True, layer=None, order=None, **kwargs)[source]#

Creates interactive violin plot.

Parameters:
  • adata (Anndata) – AnnData object.

  • groupby (str) – Category group.

  • keys (list[str]) – Genes.

Returns:

Vitessce widget. Documentation can be found here.

class easy_vitessce.spatialdata_plot.VitesscePlotAccessor(sdata)[source]#

Bases: object

A class for configuring a spatial plot, using the same syntax as spatialdata-plot.

render_images(element=None, channel=None, cmap=None, norm=None, na_color=None, palette=None, alpha=1.0, **kwargs)[source]#

Renders image.

Parameters:
  • element (str) – Name of the image element.

  • channel (list[str] or list[int] or str or int or None) – To select specific channels to plot.

  • cmap (str or None) – Colormap name such as “viridis”.

  • norm (list[matplotlib.colors.Normalize] or matplotlib.colors.Normalize or None) – Normalization or list of normalizations for continuous annotations.

  • na_color (str or None) – Color that should be rendered as transparent.

  • palette (list[str] or str or None) – Palette to color images. If list, the number of colors should be equal to the number of channels.

  • alpha (float or int) – Alpha value for the images, between 0.0 and 1.0. By default, 1.0.

Returns:

Self, allows for chaining.

render_labels(element=None, color=None, groups=None, palette=None, cmap=None, norm=None, outline_alpha=0.0, fill_alpha=0.4, table_name=None, table_layer=None, **kwargs)[source]#

Renders label data.

Parameters:
  • element (str) – Name of the labels element.

  • color (str or None) – Name of an obs column, var index value, or color-like string.

  • groups (list[str] or str or None) – List of obs group names to select.

  • palette (list[str] or str or None) – Palette to color labels. If list, the number of colors should be equal to the number of groups.

  • cmap (str or None) – Quantitative colormap name, such as “viridis”.

  • norm (matplotlib.colors.Normalize or None) – Normalization for quantitative colormap.

  • outline_alpha (float or int or None) – Alpha value for label outlines, between 0.0 and 1.0.

  • fill_alpha (float or int or None) – Alpha value for filling labels, between 0.0 and 1.0.

  • table_name (str or None) – Name of an annotating table to use for coloring.

  • table_layer (str or None) – Name of the layer in the annotating table to use for coloring.

Returns:

Self, allows for chaining.

render_points(element=None, **kwargs)[source]#

Renders points.

Parameters:

element (str) – Name of points element.

Returns:

Self, allows for chaining.

render_shapes(element=None, color=None, fill_alpha=None, groups=None, palette=None, outline_width=None, outline_color=None, outline_alpha=None, cmap=None, norm=None, table_name=None, table_layer=None, **kwargs)[source]#

Renders shapes, e.g. “cells”.

Parameters:
  • element (str) – Name of the shapes element.

  • color (str or None) – Name of an obs column, var index value, or color-like string.

  • fill_alpha (float or int or None) – Alpha value for filling shapes, between 0.0 and 1.0.

  • groups (list[str] or str or None) – List of obs group names to select.

  • palette (list[str] or str or None) – Palette to color shapes. If list, the number of colors should be equal to the number of groups.

  • outline_width (float or int or None) – Width of the shape outlines.

  • outline_alpha (float or int or None) – Alpha value for shape outlines, between 0.0 and 1.0.

  • cmap (str or None) – Quantitative colormap name, such as “viridis”.

  • norm (matplotlib.colors.Normalize or None) – Normalization for quantitative colormap.

  • table_name (str or None) – Name of an annotating table to use for coloring.

  • table_layer (str or None) – Name of the layer in the annotating table to use for coloring.

Returns:

Self, allows for chaining.

show(coordinate_systems=None, **kwargs)[source]#

Displays spatial plot.

Returns:

Vitessce widget. Learn more at the vitessce-python docs .