proteobench.plotting.plot_generator_lfq_PYE module#

Plot generator for LFQ PYE (Plasma-Yeast-Ecoli) quantification modules.

proteobench.plotting.plot_generator_lfq_PYE.DYNAMIC_RANGE_EXPLANATION = 'Dynamic range of the human plasma background: for each condition the log10-transformed mean precursor intensities of the HUMAN precursors are taken, and the difference between their 90th and 10th percentile is computed. The two condition-wise values (A and B) are then averaged. The value is therefore expressed in orders of magnitude (log10 units): a dynamic range of 3.0 means that the central 80% of the quantified plasma precursors span three orders of magnitude in intensity. Larger values indicate that a workflow quantifies both high-abundant and low-abundant plasma precursors.'#

Human-readable explanation of the human-plasma dynamic range metric. Used both as the tooltip of the main overview plot and in the in-depth plot descriptions.

class proteobench.plotting.plot_generator_lfq_PYE.LFQPYEPlotGenerator(y_axis_title: str = 'Number of quantified spike-in precursors')[source]#

Bases: LFQHYEPlotGenerator

Plot generator for LFQ PYE (Plasma-Yeast-Ecoli) quantification modules. Used by plasma benchmarking modules that use human plasma, yeast, and E. coli species.

PYE is the same mixed-species LFQ benchmark as HYE with plasma as the background instead of a human cell lysate, so it shares the intermediate schema (precursor ion, species, epsilon, log_Intensity_mean_A/B, CV_A/B) and inherits the workflow-comparison contract from LFQHYEPlotGenerator. Nearly every plot is overridden below, because the plasma module reports different metrics.

generate_in_depth_plots(performance_data: DataFrame, parse_settings: any, **kwargs) → Dict[str, Figure][source]#

Generate standard LFQ PYE plots from intermediate data.

Parameters:
  • performance_data (pd.DataFrame) – The intermediate performance data to plot

  • parse_settings (ParseSettings) – The parse settings for the module

  • **kwargs (dict) – Additional module-specific parameters

Returns:

Dictionary mapping plot names to plotly figures

Return type:

Dict[str, go.Figure]

get_in_depth_metrics_help_markdown() → str[source]#

Return a Markdown explanation of how the in-depth plots are calculated.

Returns:

The Markdown explanation shown in the “How are the metrics calculated?” popover on the in-depth tab.

Return type:

str

get_in_depth_plot_descriptions() → Dict[str, str][source]#

Get descriptions for each plot.

Returns:

Dictionary mapping plot names to their descriptions

Return type:

Dict[str, str]

get_in_depth_plot_layout() → list[source]#

Define layout for LFQ PYE plots.

Returns:

List of in-depth plot configurations defining how plots should be displayed

Return type:

list

get_metrics_help_markdown() → str[source]#

Return a Markdown explanation of how the metrics of the main plot are calculated.

Returns:

The Markdown explanation shown in the “How are the metrics calculated?” popover.

Return type:

str

plot_main_metric(result_df: DataFrame, metric: str = 'Median', mode: str = 'Species-weighted', software_colors: Dict[str, str] = {'AlphaDIA': '#1D2732', 'AlphaPept': '#cc6777', 'Custom': '#000000', 'DIA-NN': '#999934', 'FragPipe': '#342288', 'FragPipe (DIA-NN quant)': '#F89008', 'MSAID': '#bfef45', 'MSAngel': '#147733', 'MaxQuant': '#88ccef', 'MetaMorpheus': '#637C7A', 'PEAKS': '#f032e6', 'ProlineStudio': '#ddcc77', 'Proteome Discoverer': '#911eb4', 'Sage': '#671100', 'Spectronaut': '#007548', 'WOMBAT': '#44aa9a', 'i2MassChroQ': '#aa4599', 'quantms': '#f5e830'}, software_markers: Dict[str, str] = {'AlphaDIA': 'star-triangle-up', 'AlphaPept': 'square', 'Custom': 'star-square', 'DIA-NN': 'star', 'FragPipe': 'x', 'FragPipe (DIA-NN quant)': 'circle-x', 'MSAID': 'square-cross', 'MSAngel': 'cross', 'MaxQuant': 'circle', 'MetaMorpheus': 'asterisk', 'PEAKS': 'diamond-wide', 'ProlineStudio': 'diamond', 'Proteome Discoverer': 'hash', 'Sage': 'triangle-down', 'Spectronaut': 'diamond-tall', 'WOMBAT': 'pentagon', 'i2MassChroQ': 'triangle-up', 'quantms': 'hexagram'}, mapping: Dict[str, str] = {'new': 20, 'old': 10}, highlight_color: str = '#d30067', label: str = '', legend_name_map: Dict[str, str] = {'AlphaPept': 'AlphaPept (legacy tool)'}, hide_annot: bool = False, colorblind_mode: bool = False, default_cutoff_min_feature: int = 3, min_nr_observed: int = None, annotation: str = '', **kwargs) → Figure[source]#

Generate the main plasma benchmarking scatterplot.

This method returns the plasma performance scatterplot for comparing multiple methods.

Parameters:
  • result_df (pd.DataFrame) – DataFrame containing the results to plot, must have ‘results’ column with metrics.

  • metric (str, optional) – Metric to use for calculations: “Median” or “Mean”. Defaults to “Median”.

  • mode (str, optional) – Mode for metric calculation: “Global” or “Species-weighted”. Currently both modes use the same metrics for plasma. Defaults to “Species-weighted”.

  • software_colors (Dict[str, str]) – Mapping of software names to colors.

  • mapping (Dict[str, str]) – Mapping for marker sizes.

  • highlight_color (str) – Color to use for highlighting specific software.

  • label (str) – Label for plot annotations.

  • legend_name_map (Dict[str, str]) – Mapping for legend names.

  • hide_annot (bool) – Whether to hide annotations on the plot.

  • default_cutoff_min_feature (int) – Default min precursor threshold for extracting metrics.

  • min_nr_observed (int, optional) – Override the cutoff level with this value if provided.

  • annotation (str, optional) – Text annotation to display on the plot (e.g., “-Alpha-”, “-Beta-“).

  • **kwargs (dict) – Additional parameters.

Returns:

Plotly figure with the plasma scatterplot.

Return type:

go.Figure

proteobench.plotting.plot_generator_lfq_PYE.OPACITY_MIN = 0.2#

Opacity range used to encode human-plasma quantification accuracy in the overview plot. The most accurate workflow in the loaded set is drawn fully opaque, the least accurate one at OPACITY_MIN, so differences remain visible regardless of the absolute error range.

proteobench.plotting.plot_generator_lfq_PYE.PYE_SPECIES_ORDER = ('HUMAN', 'YEAST', 'ECOLI')#

Species present in the PYE (Plasma/Yeast/E. coli) sample, plasma background first.