grassp.pl.marker_profiles

grassp.pl.marker_profiles#

marker_profiles(adata, marker_column, plot_nan=False, error_type='std', xticklabels=False, ylabel='Abundance', replicate_column=None, show=True, save=None)[source]#

Plot mean profiles with error bands for each marker annotation.

Creates a single plot showing the mean profile for each marker category with shaded error regions (standard deviation or standard error).

This function assumes that adata.var is sorted by Replicate (if present) and Fraction/Pulldown, so that related measurements are adjacent on the x-axis.

Parameters:
adata AnnData

AnnData object with proteins in .var and samples/fractions in .obs.

marker_column str

Column name in adata.obs containing marker annotations.

plot_nan bool (default: False)

If True, NaN entries in the marker column are included; otherwise they are skipped.

error_type str (default: 'std')

Type of error to display: 'std' for standard deviation or 'sem' for standard error of the mean. Default is 'std'.

xticklabels bool (default: False)

If True, label x-ticks with adata.var_names.

ylabel str (default: 'Abundance')

Label for the y-axis. Default is 'Abundance'.

replicate_column str | None (default: None)

Column name in adata.var indicating replicate groups. If provided, vertical dashed lines are drawn at replicate boundaries (after the last instance of each replicate).

show bool (default: True)

If True (default) the plot is shown and the function returns None.

save bool | str | None (default: None)

If True or a str, save the figure. A string is appended to the default filename. Infer the filetype if ending on {'.pdf', '.png', '.svg'}.

Return type:

Axes | None

Returns:

Returns the Axes if show is False, otherwise None.

See also

marker_profiles_split

Plot individual profiles in separate subplots.