top_genes_counts

besca.pl.top_genes_counts(adata, top_n=25, ax=None, figsize=None)[source]

plot top n genes that contribute to fraction of counts per cell

Generate box and whisker plot of the fraction of counts in a cell per gene which shows the top n genes that most strongly contribute to UMI counts.

Parameters:
  • adata (AnnData) – AnnData object containing data that is to be visualized. Genes need to be in columns and cells in rows

  • top_n (int | default = 25) – number of genes that should be visualized in the plot

  • ax (axes | default = None) – the axes instance to which your plot should be added

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

Returns:

  • None – If an ax object is passed to the function the function returns nothing

  • Figure – If ax = None then a figure is returned

Example

>>> import besca as bc
>>> import matplotlib.pyplot as plt
>>> adata = bc.datasets.simulated_pbmc3k_raw()
>>> genes = bc.pl.top_genes_counts(adata)