opendvp.plotting.rankplot

Contents

opendvp.plotting.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.

Return type:

Figure | None

Parameters#

adataAnnData

Annotated data matrix.

adata_obs_keystr

Key in adata.obs indicating group labels.

groupslist of str

Groups from adata.obs[adata_obs_key] to include.

proteins_to_labellist of str, optional

List of feature names (in adata.var_names) to label on the plot.

group_colorsdict, optional

Dictionary mapping group names to colors. Both keys and values should be strings.

return_figbool, optional

If True, returns the matplotlib figure object for further customization.

axmatplotlib.axes.Axes, optional

Axes object to plot on. If None, a new figure and axes are created.

min_presence_fractionfloat, 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:#

figmatplotlib.figure.Figure or None

The figure object if return_fig is True, otherwise None.