"""Tour step definitions for ProteoBench guided tours."""
from __future__ import annotations
def _tab_step(n: int, title: str, desc: str):
"""Create a tour step that targets the Nth tab button (1-indexed)."""
from streamlit_tour import Step
return Step(
f'[data-baseweb="tab-list"] button:nth-child({n})',
{"title": title, "description": desc, "side": "bottom", "align": "start"},
)
[docs]
def get_homepage_tour_steps() -> list:
"""Return step list for the ProteoBench homepage tour."""
from streamlit_tour import Tour
return [
Tour.info(
title="Welcome to ProteoBench!",
desc=(
"Benchmark your proteomics data analysis pipelines " "across tools, instruments, datasets and tasks."
),
),
Tour.bind(
"tour_stats_area",
title="Statistics Overview",
desc=(
"These boxes show the current state of the ProteoBench ecosystem: "
"active modules, supported tools, and submitted datapoints."
),
),
Tour.bind(
"tour_submissions_chart",
title="Submissions per Module",
desc=("This chart shows how many benchmark runs have been submitted per module. "),
),
Tour.info(
title="Let's explore a module!",
desc=(
"Next, we will take you to the Quant LFQ DIA Astral module "
"to show you how you can benchmark your data analysis."
),
),
]
[docs]
def get_quant_tour_steps(module_name: str = "this module") -> list:
"""Return step list for a quantification module tour."""
from streamlit_tour import Tour
return [
# Intro
Tour.info(
title=f"Welcome to {module_name}",
desc=(
"This specific module benchmarks quantification depth and accuracy on data generated using DIA on an Orbitrap Astral. "
"We will guide you through a detailed walkthrough of the module. All other modules follow a similar structure, "
"so you can apply what you learn here to any module you choose to explore. "
"Click each highlighted tab to navigate, then press Next."
),
),
# Tab 1 — content is always visible as the default active tab
_tab_step(
1,
"Tab 1: View Public Results",
"This tab contains the main figure of the module, which contains all the public benchmark results submitted by the community.",
),
Tour.bind(
"tour_metric_plot",
title="Benchmark Overview Plot",
desc=(
"Each point is one workflow output. "
"In this case, the horizontal axis shows the quantification accuracy; "
"the vertical axis shows the number of quantified precursor ions. "
"After the tour, you can explore the plot by hovering over the points to see details on the corresponding workflow run."
),
side="top",
),
Tour.bind(
"tour_plot_options",
title="Filter and Display Options",
desc=(
"You can change the plot settings to customize the visualization. "
"For instance, in this module, set the minimum number of quantified precursors with the slider, "
"select the metric to display (Median or Mean), "
"and toggle between Global and Species-weighted calculation modes."
),
side="bottom",
),
Tour.bind(
"tour_results_table",
title="Benchmark Results Table",
desc=(
"A table lists all submitted benchmark results with their key parameters. "
"You can sort and filter columns to find specific tools or configurations."
"You can download this table (pop up menu on the top-right corner) to make your own plots and analysis."
),
side="top",
),
Tour.bind(
"tour_download_section",
title="Download all data from a submitted workflow",
desc=(
"Use this section to download all the data associated with a given workflow output (direct output of the workflow as submitted to ProteoBench, associated parameter file and the intermediate table generated by ProteoBench). "
"Select a dataset from the dropdown to access the files associated with that benchmark run."
),
side="top",
),
# Tab 2
_tab_step(
2,
"Tab 2: Upload New Results",
"Click this tab to upload your own workflow output and run a private benchmark. Press Next after clicking on the tab to continue the tour.",
),
Tour.bind(
"software_tool_selector",
title="Select Your Software Tool",
desc=(
"Use this dropdown menu to select the tool you used. "
"ProteoBench supports the output of many popular tools. "
"If your tool is not supported yet, select 'Custom' and upload a standardized results file described in the module documentation. "
"A custom results file cannot be submitted publicly, but it allows you to run a private benchmark and compare your results to public submissions. "
"Don't hesitate to contact us to add your tool to our list of supported software!"
),
side="bottom",
),
Tour.bind(
"tour_upload_form",
title="Upload File and Run Benchmark",
desc=(
"Upload the output of your workflow here (all compatible files are described in the module documentation). "
"Add an optional keyword to help identify this run, "
"then click 'Parse and bench' to compute benchmark metrics locally — "
"no data leaves your browser at this step."
),
side="bottom",
),
# Tab 3
_tab_step(
3,
"Tab 3: View Single Result",
"Click this tab to get benchmark plots for the workflow you just uploaded or any benhcmark run publicly available in this module. "
"Press Next after clicking to continue the tour. ",
),
Tour.bind(
"tour_dataset_selector",
title="Select a Dataset",
desc=(
"Use the dropdown to choose any entry — your uploaded result or any publicly available benchmark run. "
"Select one now, then press Next to see what the plots look like."
),
side="bottom",
),
Tour.bind(
"tour_indepth_plots",
title="In-Depth Plots",
desc=(
"After selecting a dataset, a set of detailed plots appears here to show various aspects of the benchmark result. "
"These plots are designed to help you understand the strengths and weaknesses of the selected workflow, "
"and to compare it to other submissions. "
"You can download them, and/or download the associated table to make your own analysis. "
),
side="top",
),
# Tab 4
_tab_step(
4,
"Tab 4: View Public + New Results",
"Click this tab to see your uploaded result alongside all public benchmark runs. Press Next after clicking.",
),
Tour.bind(
"tour_submitted_plot",
title="Your Result in Context",
desc=(
"After uploading a result in Tab 2, it appears highlighted in this scatter plot "
"alongside all public benchmark benchmark runs, so you can immediately see how your workflow compares."
),
side="top",
),
# Tab 5
_tab_step(
5,
"Tab 5: Compare Two Results",
"This tab allows you compare any two workflows side by side (including private results). Press Next after clicking to continue the tour.",
),
Tour.bind(
"tour_compare_plot",
title="Workflow Selection Plot",
desc=(
"This scatter plot shows all public benchmark runs. "
"Outside the tour, you can click any two points to select workflow outputs for comparison. "
"The identifiers of the selected benchmark runs are shown below the plot, and the button Clear resets the selection."
),
side="top",
),
Tour.bind(
"tour_compare_results",
title="Comparison Results",
desc=(
"After selecting two workflows, two views appear here: "
"a bar chart showing the number of precursors that are identified in one or both workflows, "
"and a table highlighting what parameters differ between the two workflows."
),
side="top",
),
# Tab 6
_tab_step(
6,
"Tab 6: Submit New Results",
"Click this tab to submit your benchmark result to the public repository. Press Next after clicking to continue the tour.",
),
Tour.bind(
"tour_meta_uploader",
title="Upload Parameter File",
desc=(
"Here you can upload the native parameter or log file from your software tool "
"(for example: MaxQuant mqpar.xml, DIA-NN report.log.txt, Spectronaut .txt export). Check the module documentation for more details. "
"ProteoBench extracts analysis settings automatically, and keeps the parameter file for full transparency."
),
side="bottom",
),
Tour.bind(
"tour_param_fields",
title="Review Extracted Parameters",
desc=(
"These fields are auto-populated from your parameter file. "
"Review each value and correct any that were not parsed correctly "
"before submitting to the public repository."
"Your submission will create a GitHub pull request, please keep its link somewhere to check it is processed, add comments, and/or ask questions to us."
),
side="top",
),
# Outro
Tour.info(
title="Tour Complete!",
desc=(
"You have seen all six tabs. "
"Start by exploring public results in Tab 1, or upload your own data in Tab 2. "
"Please don't forget to submit your results to contribute to the community effort! Happy benchmarking! "
),
),
]