proteobench.plotting.plot_generator_base module#

class proteobench.plotting.plot_generator_base.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

  • **kwargs (dict) –

    Additional module-specific parameters. Common parameters include: - parse_settings: ParseSettings - module-specific parse settings (may be optional for some modules) - metric: str - metric to display (e.g., “Median”, “Mean”) - mode: str - calculation mode (e.g., “Global”, “Species-weighted”) - colorblind_mode: bool - whether to use colorblind-friendly visualization

    Each implementation should document which parameters it accepts.

Returns:

Dictionary mapping plot names to plotly figures

Return type:

Dict[str, go.Figure]

Notes

Implementations may add parse_settings as an explicit positional parameter for consistency with generic tab code, even if not used by the module.

get_in_depth_metrics_help_markdown() → str | None[source]#

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

The web interface renders this text in the “How are the metrics calculated?” popover on the tab that shows the in-depth plots of a single benchmark run. That tab does not display the main plot, so the main-plot explanation would not apply there.

Returns:

The Markdown explanation, or None when the module does not provide one. In that case the web interface hides the popover on the in-depth tab.

Return type:

str or None

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

get_metrics_help_markdown() → str | None[source]#

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

The web interface renders this text in a “How are the metrics calculated?” popover at the top of the tabs that show the main plot. Because the explanation describes the axes and encodings of that plot, it lives next to the code that produces it.

Returns:

The Markdown explanation, or None when the module does not provide one. In that case the web interface hides the popover.

Return type:

str or None

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