grassp.pl.marker_profiles_split#
- marker_profiles_split(adata, marker_column, plot_nan=False, n_columns=3, xticklabels=False, ylabel='Abundance', replicate_column=None, plot_mean=True, show=True, save=None)[source]#
Plot sample/fraction profiles grouped by marker annotation.
Creates a grid of subplots where each subplot shows profiles for all samples/fractions assigned to a specific marker category. Each line represents one sample/fraction’s profile across all proteins.
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 get their own facet; otherwise they are skipped.- n_columns
int(default:3) Number of columns in the plot grid.
- 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).- plot_mean
bool(default:True) If
True(default), plot the mean profile across all samples/fractions in each category as a black line. A legend is added to the last subplot.- 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 array of Axes if
showisFalse, otherwiseNone.
See also
marker_profilesPlot mean profiles with error bands in a single plot.