tacco.plots.frequency_bar

frequency_bar(adata, keys, colors=None, show_only=None, axsize=None, basis_adata=None, basis_keys=None, horizontal=True, reads=False, method_labels=None, counts_location=None, ax=None)[source]

Bar plots of the total frequency of annotation in the whole dataset against some reference dataset.

Parameters:
  • adata – An AnnData including annotation in .obs and/or .obsm. Can also be a mapping of labels to AnnData to specify multiple datasets. The AnnData instances can be replaced also by DataFrame, which are then treated like the .obs of an AnnData.

  • keys – The .obs/.obsm annotation keys to compare. Can be a single string, or a list of strings, or a mapping of the labels of adata to strings or lists of strings.

  • colors – A mapping of annotation values to colors. If None, default colors are used.

  • show_only – A subset of annotation values to restrict the plotting to.

  • axsize – Tuple of width and size of a single axis. If None, a default size is chosen automatically.

  • basis_adata – like adata, but for reference data.

  • basis_keys – like adata, but for reference data.

  • horizontal – Whether to draw the bars horizontally.

  • reads – Whether to work with read or cell count fractions.

  • method_labels – A mapping from the strings in keys and basis_keys to (shorter) names to show in the plot.

  • counts_location – A string or tuple specifying where the count matrix is stored, e.g. ‘X’, (‘raw’,’X’), (‘raw’,’obsm’,’my_counts_key’), (‘layer’,’my_counts_key’), … For details see counts().

  • ax – The Axes to plot on. If None, creates a fresh figure for plotting.

Returns:

The Figure containing the plot.