gedi2py.plotting.variance_explained

gedi2py.plotting.variance_explained(adata, *, key='gedi', n_components=None, figsize=(8, 4), show=None, save=None, return_fig=False)[source]

Plot variance explained by GEDI components.

Shows the proportion of variance explained by each latent factor based on the SVD singular values.

Parameters:
  • adata (AnnData) – Annotated data matrix with GEDI SVD computed.

  • key (str, default: 'gedi') – Key prefix for GEDI results.

  • n_components (int | None, default: None) – Number of components to show. If None, shows all.

  • figsize (tuple[float, float], default: (8, 4)) – Figure size.

  • show (bool | None, default: None) – If True, show the figure.

  • save (str | None, default: None) – Path to save the figure.

  • return_fig (bool, default: False) – If True, return the figure.

Return type:

Figure if ``return_fig=True``, else ``None`.`

Examples

>>> import gedi2py as gd
>>> gd.tl.svd(adata)
>>> gd.pl.variance_explained(adata)