tacco.plots.frequency

frequency(adata, keys, colors=None, show_only=None, axsize=(1.5, 1.5), basis_adata=None, basis_keys=None, reads=False, method_labels=None, counts_location=None)[source]

Scatter 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.

  • basis_adata – like adata, but for reference data.

  • basis_keys – like adata, but for reference data.

  • 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().

Returns:

A Figure.