.cv_by_group

proteopy.pl.cv_by_group(adata, group_by, layer=None, zero_to_na=False, min_samples=None, force=False, order=None, color_scheme=None, alpha=0.8, hline=None, show_points=False, point_alpha=0.7, point_size=1, xlabel_rotation=0, figsize=(6, 4), show=True, ax=False, save=None)[source]

Compute per-group coefficients of variation and plot their distributions.

Parameters:
  • adata (AnnData) – AnnData object that contains proteomics quantifications.

  • group_by (str) – Column in adata.obs used to define observation groups for CV calculation.

  • layer (str | None, optional) – AnnData layer to read intensities from. Defaults to adata.X.

  • zero_to_na (bool, optional) – Replace zero values with NaN before computing CVs. Default is False.

  • min_samples (int | None, optional) – Minimum number of observations per variable required to compute a CV. Variables with fewer non-NaN entries receive NaN. Default is 3. Ignored when using precomputed CV data from adata.varm.

  • force (bool, optional) – Force recomputation of CV values even if precomputed data exists in adata.varm. When True, uses a temporary slot that is deleted after extracting the data. Default is False.

  • order (list | None, optional) – Explicit order of group labels (without the cv_ prefix) along the x-axis. When None the observed group order is used.

  • color_scheme (sequence, dict | None, optional) – Color assignments for groups. When None, uses the Matplotlib default color cycle.

  • alpha (float, optional) – Transparency for the violin bodies. Default is 0.8.

  • hline (float | None, optional) – If set, draw a horizontal dashed line at this CV value.

  • show_points (bool, optional) – Overlay individual variable CVs as a strip plot. Default is False.

  • point_alpha (float, optional) – Opacity for individual points when show_points is True.

  • point_size (float, optional) – Size of the individual CV points. Default is 1.

  • xlabel_rotation (float, optional) – Rotation angle (degrees) for the x-axis group labels.

  • figsize (tuple of float, optional) – Matplotlib figure size in inches. Default is (6, 4).

  • show (bool, optional) – Call plt.show() when True. Default is True.

  • ax (bool, optional) – Return the Matplotlib Axes if True.

  • save (str | None, optional) – Path to save the figure. When None the figure is not saved.