opendvp.pl.rankplot

Contents

opendvp.pl.rankplot#

rankplot(adata, adata_obs_key, min_presence_fraction=0.7, groups=None, proteins_to_label=None, group_colors=None, return_fig=False, ax=None, **kwargs)#

Plot a rank plot of average protein abundance in an AnnData object.

Parameters:
  • adata (anndata.AnnData) – Annotated data matrix.

  • adata_obs_key (str) – Key in adata.obs indicating group labels.

  • groups (list of str) – Groups from adata.obs[adata_obs_key] to include.

  • proteins_to_label (list of str, optional) – List of feature names (in adata.var_names) to label on the plot.

  • group_colors (dict, optional) – Dictionary mapping group names to colors. Both keys and values should be strings.

  • return_fig (bool, optional) – If True, returns the matplotlib figure object for further customization.

  • ax (matplotlib.axes.Axes, optional) – Axes object to plot on. If None, a new figure and axes are created.

  • min_presence_fraction (float, optional) – Minimum fraction of non-NaN values required for a feature to be included in ranking (default: 0.7).

  • **kwargs – Additional keyword arguments passed to matplotlib plot.

Returns:

fig – The figure object if return_fig is True, otherwise None.

Return type:

matplotlib.figure.Figure or None