.n_peptides_per_sample

proteopy.pl.n_peptides_per_sample(adata, group_by=None, order_by=None, order=None, ascending=False, zero_to_na=False, layer=None, figsize=(6.0, 4.0), level=None, ylabel='Nr. vars detected', xlabel_rotation=90, order_by_label_rotation=0, show=True, ax=False, save=False, color_scheme=None)

Plot the number of detected peptides per observation.

Parameters:
  • adata (AnnData) – AnnData object with proteomics annotations.

  • group_by (str | None) – Optional column in adata.obs used to summarise observations into groups. When provided, a boxplot of detected variables per group is shown. Mutually exclusive with order_by.

  • order_by (str | None) – Optional column in adata.obs used to assign group labels.

  • order (Sequence[str] | None) – Determines the x-axis order. Without group_by or order_by it should list observation names. With order_by it specifies the group order for the stacked bars. With group_by it specifies the group order for the boxplot.

  • ascending (bool) – When both group_by and order_by are None and order is None, sort observations by detected counts. False places higher counts to the left. True places lower counts to the left.

  • zero_to_na (bool) – Treat zero entries as missing values when True.

  • layer (str | None) – Name of an alternate matrix in adata.layers. Defaults to adata.X.

  • figsize (tuple[float, float]) – Figure size supplied to matplotlib.pyplot.subplots().

  • xlabel_rotation (float) – Rotation in degrees applied to x tick labels.

  • order_by_label_rotation (float) – Rotation in degrees applied to group labels drawn above the plot.

  • show (bool) – Call matplotlib.pyplot.show() when True.

  • ax (bool) – Return the Axes instead of displaying the plot.

  • save (str | Path | None) – Path or truthy value triggering Figure.savefig.

  • color_scheme (Any | None) – Optional mapping or palette controlling bar colours.

  • Note – This function is a partial of n_var_per_sample, with the following arguments fixed: level=’peptide’, ylabel=’Nr. peptides detected’.

Return type:

Axes | None