proteobench.plotting package#

Plotting module for ProteoBench.

class proteobench.plotting.LFQHYEPlotGenerator[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_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_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

plot_main_metric(benchmark_metrics_df: DataFrame, metric: str = 'Median', mode: str = 'Species-weighted', software_colors: Dict[str, str] = {'AlphaDIA': '#1D2732', 'AlphaPept': '#17212b', 'Custom': '#000000', 'DIA-NN': '#d42f2f', 'FragPipe': '#F89008', 'FragPipe (DIA-NN quant)': '#F89008', 'MSAID': '#bfef45', 'MSAngel': '#C0FA7D', 'MaxQuant': '#8bc6fd', 'MetaMorpheus': '#637C7A', 'PEAKS': '#f032e6', 'ProlineStudio': '#8b26ff', 'Proteome Discoverer': '#911eb4', 'Sage': '#E43924', 'Spectronaut': '#007548', 'WOMBAT': '#663200', 'i2MassChroQ': '#108E2E', 'quantms': '#f5e830'}, 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, **kwargs) Figure[source]#

Generate the main performance metric plot for LFQ HYE modules.

Parameters:
  • benchmark_metrics_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.

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

  • 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.

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

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

Returns:

Plotly figure with the main performance metric plot.

Return type:

go.Figure

class proteobench.plotting.PlotGeneratorBase[source]#

Bases: ABC

Abstract base class for module-specific plot generators. Each module can extend this to define its own in-depth plots.

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

Generate module-specific plots.

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

  • 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]

abstractmethod 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]

abstractmethod get_in_depth_plot_layout() list[source]#

Define the layout configuration for displaying plots.

Returns:

List of plot configurations, e.g.: [

{“plots”: [“logfc”, “cv”], “columns”: 2, “title”: “Distribution Plots”}, {“plots”: [“ma_plot”], “columns”: 1, “title”: “MA Plot”}

]

Return type:

list

abstractmethod plot_main_metric(result_df: DataFrame, hide_annot: bool = False, **kwargs) Figure[source]#

Generate the main performance metric plot for the module.

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

  • hide_annot (bool, optional) – Whether to hide annotations on the plot (default is False).

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

Returns:

The generated plotly figure for the main performance metric.

Return type:

go.Figure

Submodules#