thor.pl.single_molecule

thor.pl.single_molecule(var, var_expression, cells_pixels, image_size=None, global_norm=True, **single_kwds)[source]

Color the cells or nuclei with a variable, gene or any observable (gene expression vector as input).

Parameters:
  • var (str) – Variable name to color the cells or nuclei.

  • var_expression (numpy 1d array) – Array of shape (n_cells, ) containing the expression values of the variables.

  • cells_pixels (list of numpy arrays) – List of numpy arrays representing the pixels of each cell or nucleus.

  • image_size (tuple, optional) – Tuple (height, width) representing the size of the image.

  • global_norm (bool, optional) – If True, normalize the expression values of each variable across all cells. Default is True.

  • **single_kwds (dict, optional) – Additional keyword arguments for the single function.

Returns:

If return_fig is False and show is False, the function returns the Axes object. If return_fig is True, the function returns the Figure object. If show is True, the function displays the plot and returns None.

Return type:

matplotlib.axes._subplots.AxesSubplot or matplotlib.figure.Figure, optional