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.varis 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.obscontaining 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 withadata.var_names.- ylabel
str(default:'Abundance') Label for the y-axis. Default is
'Abundance'.- replicate_column
str|None(default:None) Column name in
adata.varindicating 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 returnsNone.- save
bool|str|None(default:None) If
Trueor astr, save the figure. A string is appended to the default filename. Infer the filetype if ending on{'.pdf', '.png', '.svg'}.
- adata
- Return type:
Axes|None- Returns:
Returns the Axes if
showisFalse, otherwiseNone.
See also
marker_profiles_splitPlot individual profiles in separate subplots.