opendvp.plotting.rankplot#
- opendvp.plotting.rankplot(adata, adata_obs_key, groups, proteins_to_label=None, group_colors=None, group_offset=None, return_fig=False, ax=None, **kwargs)#
Plot a rank plot of average protein abundance in an AnnData object.
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.
- group_offsetdict, optional
Dictionary mapping group names to x-axis offset (for shifting lines).
- 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.
- **kwargs
Additional keyword arguments passed to matplotlib plot.
Returns:#
- figmatplotlib.figure.Figure or None
The figure object if return_fig is True, otherwise None.