.intensity_box_per_sample
- proteopy.pl.intensity_box_per_sample(adata, layer=None, order_by=None, order=None, group_by=None, zero_to_na=False, fill_na=None, log_transform=None, z_transform=False, ylabel='Intensity', xlabel_rotation=90, order_by_label_rotation=0, show=True, ax=None, save=None, figsize=(8, 5), color_scheme=None)[source]
Plot intensity distributions as boxplots, either per observation or pooled by a categorical grouping.
- Parameters:
adata (AnnData) – Proteomics
AnnData.layer (str, optional) – Key in
adata.layersproviding the matrix to plot. WhenNone, useadata.X.order_by (str, optional) – Column in
adata.obswhose categories annotate observation groups in per-observation mode. Mutually exclusive withgroup_by.order (Sequence[str], optional) – Explicit order of
order_bycategories. Whengroup_byis provided, these values order the grouped categories on the x-axis.group_by (str, optional) – Column in
adata.obsused to pool observations into a single box per category. WhenNone, each observation is shown individually.zero_to_na (bool, optional) – Convert zero intensities to
NaNbefore other transforms.fill_na (float, optional) – Replace missing intensities with this value before transformations.
log_transform (float, optional) – Logarithm base (>0 and !=1). Applies
log(value + 1, base).z_transform (bool, optional) – Standardize intensities per observation after the log transform.
ylabel (str, optional) – Label for the y-axis.
xlabel_rotation (float, optional) – Rotation angle for observation tick labels.
order_by_label_rotation (float, optional) – Rotation angle for the group labels drawn above the axis.
show (bool, optional) – Display the figure when
Trueand a new axis is created.ax (Axes, optional) – Axis to draw on. When
None, a new figure and axis are created.save (str | os.PathLike, optional) – Path to save the figure.
Noneskips saving.figsize (tuple of float, optional) – Figure size used when creating a new axis.
color_scheme (Any, optional) – Palette forwarded to
proteopy.utils.matplotlib._resolve_color_scheme()for either grouped categories (group_by) or observation-level annotations (order_by).
- Returns:
Axis containing the rendered boxplot.
- Return type:
Axes