.peptide_intensities
- proteopy.pl.peptide_intensities(adata, protein_ids=None, order_by=None, order=None, groups=None, facet_by=None, color=None, group_by=None, log_transform=None, fill_na=None, z_transform=False, show_zeros=True, xlab_rotation=0, order_by_label_rotation=0, figsize=(15, 6), show=True, save=None, ax=None, color_scheme=None)[source]
Plot peptide intensities across samples for the requested proteins.
- Parameters:
adata (AnnData) – Proteomics
AnnData.protein_ids (str | Sequence[str]) – Show peptides mapping to this protein_id.
order_by (str, optional) – Column in
adata.obsused to group and order observations on the x-axis. WhenNone, observations followadata.obs_names.order (Sequence[str], optional) – Explicit order of groups (when
order_byis set) or observations (whenorder_byisNone).groups (str | Sequence[str], optional) – Restrict
order_byto selected categorical levels (requiresorder_by). The provided order determines the plotting order unlessorderis supplied.facet_by (str | list[str | None], optional) – Columns in
adata.obsused to split samples across a subplot grid. A string is coerced to[facet_by, None]. A list must contain exactly two elements: the row annotation followed by the column annotation. Either element may beNoneto collapse that grid axis. Within each facet,order_bygroups and orders only the samples in that facet. Cannot be combined withax.color (str, optional) –
adata.varcolumn used for per-peptide coloring.group_by (str, optional) –
adata.varcolumn whose categories are aggregated into a single line. Mutually exclusive withcolor; each group is colored viacolor_scheme.log_transform (float, optional) – Logarithm base (>0 and !=1). Values are transformed as
log(value + 1, base).fill_na (float, optional) – Replace missing intensities before zero/log/z transformations when set.
z_transform (bool, optional) – Standardize each peptide across observations after optional log transform. Skips NA.
show_zeros (bool, optional) – Display zero intensities when
True; otherwise zeros becomeNaN.xlab_rotation (float, optional) – Rotation angle (degrees) applied to x-axis tick labels.
order_by_label_rotation (float, optional) – Rotation angle for the group labels drawn above grouped sections.
figsize (tuple[float, float], optional) – Size of each panel. Faceted figures scale this size by the number of subplot columns and rows.
color_scheme (Any, optional) – Palette specification forwarded to
proteopy.utils.matplotlib._resolve_color_scheme()for either the per-peptidecoloror aggregatedgroup_bycategories.show (bool, optional) – Display the generated figure(s) with
matplotlib.pyplot.show().save (str | os.PathLike, optional) – Path for saving the figure(s). Multi-protein selections are written to a PDF stack.
ax (matplotlib.axes.Axes, optional) – Axes object to plot onto. If
None, create a new figure and axes. Cannot be combined withfacet_byor multipleprotein_ids.
- Returns:
The Axes object used for one plot, or a list of Axes objects when multiple plots are created.
- Return type:
Axes | list[Axes]