.intensity_hist
- proteopy.pl.intensity_hist(adata, layer=None, color_imputed=False, bool_layer=None, log_transform=None, ignore_warning=False, fill_na=None, zero_to_nan=False, bins=60, density=True, kde=False, color_scheme=None, xlim=None, alpha=0.6, title=None, legend_loc='upper right', figsize=(7, 4), per_obs=False, samples=None, ncols=4, sharex=True, sharey=True, show=True, ax=False, save=None)[source]
Plot histogram(s) of var intensities, optionally colored by imputation status.
- Parameters:
adata (AnnData) – Proteomics
AnnDatacontaining the intensity matrix.layer (str | None, optional) – Layer to use for intensities; defaults to
adata.XwhenNone.color_imputed (bool, optional) – When
True, overlay imputed values using the layer-specific mask; otherwise plot a single distribution of all intensities.bool_layer (str | None, optional) – Layer key containing the imputation mask. When
Noneandcolor_imputedisTrue, useimputation_mask_<layer>(withlayer="X"for the main matrix).log_transform (float | int | None, optional) – Logarithm base (>0 and !=1). When
Noneskip log-transforming; otherwise applylog(value + 1, base)after validating the input (Defaut = None).ignore_warning (bool, optional) – When
True, force the log transform even if the data already appear log-transformed according tocopro.utils.array.is_log_transformed().fill_na (float | int | None, optional) – Replace missing values with this constant before log transformation.
zero_to_nan (bool, optional) – When True, replace exact zeros with
NaNbefore plotting.bins (int, optional) – Number of histogram bins passed to
numpy.histogram_bin_edges.density (bool, optional) – Plot density instead of counts.
kde (bool, optional) – Overlay kernel density estimate curves.
color_scheme (Any, optional) – Palette specification forwarded to
proteopy.utils.matplotlib._resolve_color_scheme().xlim (tuple[float | int, float | int] | None, optional) – Explicit x-axis limits
(xmin, xmax)applied to all histograms.alpha (float, optional) – Histogram transparency (0-1 range).
title (str | None, optional) – Custom title for the plot; defaults are auto-generated.
legend_loc (str, optional) – Location argument forwarded to
matplotlib.axes.Axes.legend().figsize (tuple[float, float], optional) – Figure size passed to
matplotlib.pyplot.subplots().per_obs (bool, optional) – When
True, draw per-observation facets; otherwise aggregate all values.samples (list | None, optional) – Optional ordered subset of observations (by index or name) for
per_obsplots.ncols (int, optional) – Number of columns in the per-observation facet grid.
sharex (bool, optional) – Whether subplots share their x- or y-axes in per-observation mode.
sharey (bool, optional) – Whether subplots share their x- or y-axes in per-observation mode.
show (bool, optional) – If True, call plt.show() at the end.
ax (bool, optional) – When
Trueandper_obsisFalse, return the Axes handle and skip automatic plotting even ifshowisTrue.save (str | Path | None, optional) – Path where the figure should be written. When
None, no file is saved.
- Returns:
Axes handle when
axisTrue(single histogram mode); otherwiseNone.- Return type:
Axes | None