webinterface.UI_utils module#

webinterface.UI_utils.build_submissions_figure()[source]#

Build a Plotly figure with faceted vertical bar charts showing submissions per module, one subplot per category (DDA, DIA, etc.). Excludes archived modules. Each bar stores its results_repo name in customdata for click-based pie chart interaction.

Returns:

The bar figure and a mapping of module title to per-tool counts.

Return type:

tuple(plotly.graph_objects.Figure, Dict[str, Dict[str, int]]) or (None, None)

webinterface.UI_utils.build_tool_pie_chart(module_title: str, tool_counts: Dict[str, int])[source]#

Build a Plotly pie chart showing tool breakdown for a given module.

Parameters:
  • module_title (str) – The module title for the chart heading.

  • tool_counts (Dict[str, int]) – Mapping of software_name to submission count.

Return type:

plotly.graph_objects.Figure

webinterface.UI_utils.get_base64_image(path)[source]#
webinterface.UI_utils.get_module_submission_data() Dict[str, Dict[str, int]][source]#

Fetch submission data per module by downloading repo archives. Returns per-tool submission counts for each module. Requests are made concurrently to minimize latency.

Returns:

Mapping of results_repo name to {software_name: count} dict.

Return type:

Dict[str, Dict[str, int]]

webinterface.UI_utils.get_monthly_visitors(api_endpoint: str, token: str, id_site: int) int | None[source]#

Gets the monthly visitors count from the Matomo API.

Parameters:
  • api_endpoint (str) – The API endpoint URL of the Matomo installation

  • token (str) – The authentication token (from Matomo)

  • id_site (int) – The site ID (from Matomo)

Returns:

The number of monthly visitors (nb_uniq_visitors of last 30 days), or None if retrieval/parsing failed.

Return type:

Optional[int]

webinterface.UI_utils.get_n_modules()[source]#

Get the number of modules in ProteoBench.

Returns:

The number of modules.

Return type:

int

webinterface.UI_utils.get_n_modules_proposed(rst_text: str) int[source]#

Computes the number of proposed modules as the sum of modules ‘in discussion’ and ‘in development’.

Parameters:

status_counts (Dict[str, int]) – A dictionary of status counts as returned by parse_proteobench_index().

Returns:

The total number of proposed modules.

Return type:

int

webinterface.UI_utils.get_n_submitted_points(url: str = 'https://proteobench.cubimed.rub.de/datasets/')[source]#

Get the number of submitted points in ProteoBench.

Returns:

The number of submitted points (excluding ‘fasta/’ and ‘raw_files/’).

Return type:

int

webinterface.UI_utils.get_n_supported_tools()[source]#

Get the number of supported tools in ProteoBench.

Returns:

The number of supported tools.

Return type:

int

webinterface.UI_utils.parse_proteobench_index(rst_text: str) Dict[str, int][source]#

Parses the ProteoBench index.rst and counts modules by status.

This version assumes that each module starts with ‘.. grid-item-card::’ and that the badge line contains ‘:bdg-’ followed by the status.

Parameters:

rst_text (str) – The text content of the index.rst file.

Returns:

Dictionary mapping statuses to counts.

Return type:

Dict[str, int]

webinterface.UI_utils.stat_box(title, value, icon_path, url=None)[source]#