proteobench.plotting.plot_generator_lfq_HYE module#

class proteobench.plotting.plot_generator_lfq_HYE.LFQHYEPlotGenerator(y_axis_title: str = 'Total number of features quantified in the selected number of raw files')[source]#

Bases: PlotGeneratorBase

Plot generator for LFQ HYE (Human-Yeast-Ecoli) quantification modules. Used by DIA/DDA ion modules that use the HYE benchmark dataset.

generate_comparison_plots(intermediates: Dict[str, DataFrame], **kwargs) → Dict[str, Figure][source]#

Generate the plots that compare several benchmark runs with each other.

Unlike generate_in_depth_plots, which describes a single run, these plots take the intermediate tables of several runs at once. LFQ modules that offer no such plot inherit this default, which returns nothing, and show only the two generic comparison tabs.

Parameters:
  • intermediates (Dict[str, pd.DataFrame]) – Mapping of workflow label (e.g. a ProteoBench ID) to that workflow’s intermediate DataFrame.

  • **kwargs (dict) – Additional module-specific parameters. Implementations should document which ones they accept; precursor_column_name is the usual one.

Returns:

Dictionary mapping plot names to plotly figures. Empty by default.

Return type:

Dict[str, go.Figure]

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

Generate standard LFQ HYE plots.

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

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

  • recalculate (bool) – Whether to recalculate or use cached plots

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

Returns:

Dictionary mapping plot names to plotly figures

Return type:

Dict[str, go.Figure]

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

Get descriptions for each comparison tab.

The web interface renders the description under the tab title. Keys match the name values of get_comparison_plot_layout.

Returns:

Dictionary mapping comparison tab names to their descriptions.

Return type:

Dict[str, str]

get_comparison_plot_layout() → List[dict][source]#

Define the full set of tabs the workflow comparison shows, and in which order.

This is the complete specification the web interface renders, so an LFQ module controls its comparison tabs entirely from its plot generator. Two names are rendered by the web interface itself rather than by a figure, because they combine a plot with widgets: precursor_overlap and parameter_differences. Every other name must match a key returned by generate_comparison_plots.

The default returns only the two generic tabs. Modules that add a comparison plot should extend rather than replace it, for example return super().get_comparison_plot_layout() + [{"name": ..., "title": ...}].

Returns:

List of tab configurations, each with a name and a title.

Return type:

List[dict]

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 HYE 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_accuracy_vs_abundance(intermediates: Dict[str, DataFrame], **kwargs) → Figure[source]#

Compare quantification accuracy over the abundance range of each workflow.

A module opts into this comparison plot by returning it from generate_comparison_plots. The figure is large enough to own its module: see proteobench.plotting.utils.accuracy_vs_abundance for what it shows and what its two dropdowns change.

Parameters:
Returns:

The figure, or a placeholder carrying an explanatory message when it cannot be built.

Return type:

go.Figure

plot_main_metric(result_df: DataFrame, metric: str = 'Median', mode: str = 'Species-weighted', colorblind_mode: bool = False, 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)'}, annotation: str = '', **kwargs) → Figure[source]#

Generate the main performance metric plot for LFQ HYE modules.

Parameters:
  • result_df (pd.DataFrame) – DataFrame containing the results to plot.

  • metric (str, optional) – Metric to plot, either “Median” or “Mean”.

  • mode (str, optional) – Mode of calculation, either, “Species-weighted” or “Global”. Case-insensitive.

  • colorblind_mode (Bool, optional) – If True, use different shapes for workflows.

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

  • software_markers (Dict[str, str]) – Mapping of software names to markers.

  • mapping (Dict[str, str]) – Mapping for renaming software versions.

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

  • label (str) – Label for the highlighted software/tool.

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

  • annotation (str) – Extra text shown next to the highlighted software/tool.

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

Returns:

Plotly figure with the main performance metric plot.

Return type:

go.Figure

plot_precursor_overlap(workflow_1_id: str, precursors_1: Iterable[str], workflow_2_id: str, precursors_2: Iterable[str]) → Figure[source]#

Plot how many features two workflows share and how many are unique to each.

The comparison is plain set arithmetic on the feature identifiers, so it applies to every LFQ quant module, whose intermediate tables all identify features by a precursor ion or peptidoform column.

Parameters:
  • workflow_1_id (str) – Label of the first workflow, used in the legend.

  • precursors_1 (Iterable[str]) – Feature identifiers quantified by the first workflow.

  • workflow_2_id (str) – Label of the second workflow, used in the legend.

  • precursors_2 (Iterable[str]) – Feature identifiers quantified by the second workflow.

Returns:

A grouped bar chart with one bar for the features unique to each workflow and one for the features they share.

Return type:

go.Figure