dot_heatmap_split_greyscale

besca.pl.dot_heatmap_split_greyscale(adata, genes, split_by, group_by='louvain', abbreviations=None, plot_absolute=True, raw=True, figsize=None, order=None, switch_axis=False, rotation=None)[source]

Generate a dot plot, filled with heatmap of individuals cells gene expression to compare two conditions (greyscale).

This function generates a plot where the genes are plotted on the X-axis and the groups on the y-axis. For each coordinate two side-by-side circle plots are generated where the size of the circle represents the number of cells in the group and the fill of the circle shows the gene expression of each individual cell as a sorted heatmap. The two circles represent the cells in that group from each condition.

If switch_axis = True then the genes are plotted on the y-axis and the groups on the x-axis.

Note this function takes some time to calculate depending on the number of individual points that need to be plotted.

Note: currently this function is only implemented to support pairwise comparisions (i.e. with a maximum of two groups)

Parameters:
  • adata (AnnData) – anndata object containing data that is to be visualized

  • genes ([‘str’]) – list of strings identifying the genes that are to be plotted

  • split_by (str) – string identifying the column in adata.obs that is to be used to identify the two conditions. May only contain two different labels.

  • group_by (str | default = ‘louvain’) – string identifying the column in adata.obs that is to be used to generate the groups

  • abbreviations ([‘str’] | default = None) – optional parameter which accepts a list of strings identifying the abbreviations for the two groups that should be plotted atop each dot row, if none is supplied it plots the entire group name. The list needs to be supplied in the correct order assuming alphabetically sorted conditions.

  • plot_absolute (bool | default) – boolian value used to indicate if the absolute geneexpression or the relativ gene expression should be plotted (currently not fully implemented)

  • raw (bool | default = True) – boolian value indicating if the data saved in adata.raw should be used to generate the plot

  • figsize ((value, value) or None | default = None) – optional parameter to define the figure size of the plot that is to be generated

  • order ([‘str’] or None | default = None) – optional parameter to pass an ordered list of groups to the function to specify the order in which they are to be plotted

  • switch_axis (bool | default = False) – boolian value to determine if the axes should be switched. Per default the genes are plotted on the x-axis.

  • rotation (int) – optional parameter to define by which degree the labels on the x-axis should be rotatet. Per default this is 0 if the genes are plotted on the x-axis and 90 if the group labels are plotted on the x-axis.

Returns:

A matplotlib figure element containing the generated plot. To save the figure this plot will need to be passed to a parameter and saved in a second step through the fig.savefig() function call.

Return type:

Figure