kp_genes

besca.pl.kp_genes(adata, threshold=0, min_genes=100, ax=None, figsize=None)[source]

visualize the minimum gene per cell threshold.

Generates a “knee-plot” to visualize the chosen threshold for the minimum number of genes that a cell expresses to validate if this is a good threshold.

Parameters:
  • adata (AnnData) – The annotated data matrix.

  • threshold (int | default = 0) – integer value that defines the minimum expression threshold for a gene to be defined as expressed. Default value is 0.

  • min_genes (int | default = 100) – visualize the chosen minimum gene threshold (default is set to 100)

  • ax (axes | default = None) – pass the axes class to which your figure 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:

Figure is displayed

Return type:

None

Example

Generate a “knee-plot” for a minimum of 600 expressed genes per cell for an example dataset. >>> import besca as bc >>> import matplotlib.pyplot as plt >>> adata = bc.datasets.simulated_pbmc3k_raw() >>> min_genes = 600 >>> fig, ax1 = plt.subplots(1) >>> bc.pl.kp_genes(adata, min_genes = min_genes, ax = ax1)