webinterface.pages.base_pages.quant module#

Streamlit-based web interface for ProteoBench.

class webinterface.pages.base_pages.quant.QuantUIObjects(variables_quant: VariablesDDAQuant, ionmodule: DDAQuantIonModuleQExactive, parsesettingsbuilder: ParseSettingsBuilder, page_name: str = '/')[source]#

Bases: object

Main class for the Streamlit interface of ProteoBench quantification. This class handles the creation of the Streamlit UI elements, including the main page layout, input forms, results display, and data submission elements.

Parameters:
  • variables_quant (VariablesDDAQuant) – The variables for the quantification module.

  • ionmodule (IonModule) – The quantification module.

  • parsesettingsbuilder (ParseSettingsBuilder) – The parse settings builder.

clear_highlight_column() None[source]#

Remove the highlight column from the submission data if it exists.

copy_dataframes_for_submission() None[source]#

Create copies of the dataframes before submission.

create_pull_request(params: Any) str | None[source]#

Submit the pull request with the benchmark results and returns the PR URL.

Parameters:

params (Any) – The parameters object.

Returns:

The URL of the pull request.

Return type:

Optional[str]

display_all_data_results_main() None[source]#

Display the results for all data in Tab 1.

display_all_data_results_submitted() None[source]#

Display the results for all data in Tab 3.

display_download_section(reset_uuid=False) None[source]#

Render the selector and area for raw data download.

Parameters:

reset_uuid (bool, optional) – Whether to reset the UUID, by default False.

display_existing_results() None[source]#

Display the results section of the page for existing data.

display_indepth_plots() None[source]#

Display the dataset selection dropdown and plot the selected dataset.

display_public_submission_ui() None[source]#

Display the public submission section of the page in Tab 4.

display_submission_form() None[source]#

Create the main submission form for the Streamlit UI in Tab 2.

display_submitted_results() None[source]#

Display the results section of the page for submitted data.

execute_proteobench() None[source]#

Execute the ProteoBench benchmarking process.

filter_data_main_slider() DataFrame[source]#

Filter the data points based on the slider value.

Returns:

The filtered data points.

Return type:

pandas.DataFrame

filter_data_submitted_slider() DataFrame[source]#

Filter the data points based on the slider value.

Returns:

The filtered data points.

Return type:

pd.DataFrame

generate_additional_parameters_fields() None[source]#

Create the additional parameters section of the form and initializes the parameter fields.

generate_additional_parameters_fields_submission() None[source]#

Create the additional parameters section of the form and initializes the parameter fields.

generate_comments_section() None[source]#

Create the text area for submission comments.

generate_confirmation_checkbox() None[source]#

Create the confirmation checkbox for metadata correctness.

generate_indepth_plots(recalculate: bool, public_id: str | None, public_hash: str | None) Figure[source]#

Generate and return plots based on the current benchmark data in Tab 2.5.

Parameters:
  • recalculate (bool) – Whether to recalculate the plots.

  • public_id (Optional[str], optional) – The dataset to plot, either “Uploaded dataset” or name of public run.

  • public_hash (Optional[str], optional) – The hash of the selected public dataset. If None, the uploaded dataset is displayed.

Returns:

The generated plots for the selected dataset.

Return type:

go.Figure

generate_input_fields() None[source]#

Create the input section of the form.

generate_input_widget(input_format: str, content: dict, key: str = '', editable: bool = True) Any[source]#

Generate input fields in the Streamlit UI based on the specified format and content.

Parameters:
  • input_format (str) – The input format.

  • content (dict) – The content of the input fields.

  • key (str) – The key of the input fields.

  • editable (bool) – Whether the input fields are editable.

Returns:

The input fields.

Return type:

Any

generate_main_selectbox() None[source]#

Create the selectbox for the Streamlit UI.

generate_main_slider() None[source]#

Create a slider input.

generate_metadata_uploader() None[source]#

Create the file uploader for meta data.

generate_sample_name() str[source]#

Generate a unique sample name based on the input format, software version, and the current timestamp.

Returns:

The generated sample name.

Return type:

str

generate_submission_button() str | None[source]#

Create a button for public submission and returns the PR URL if the button is pressed.

Returns:

The URL of the pull request.

Return type:

Optional[str]

generate_submission_ui_elements() None[source]#

Create the UI elements necessary for data submission, including metadata uploader and comments section.

generate_submitted_selectbox() None[source]#

Create the selectbox for the Streamlit UI.

generate_submitted_slider() None[source]#

Create a slider input.

generate_text_area_widget(input_format: str, content: dict, editable: bool = True) Any[source]#

Generate a text area input field.

Parameters:
  • input_format (str) – The input format.

  • content (dict) – The content of the text area.

  • editable (bool) – Whether the text area is editable.

Returns:

The text area input field.

Return type:

Any

get_form_values() Dict[str, Any][source]#

Retrieve all user inputs from Streamlit session state and returns them as a dictionary.

Returns:

A dictionary containing all user inputs.

Return type:

Dict[str, Any]

handle_submitted_table_edits() None[source]#

Callback function for handling edits made to the data table in the UI.

initialize_main_data_points() None[source]#

Initialize the all_datapoints variable in the session state.

initialize_main_slider() None[source]#

Initialize the slider for the main data.

initialize_submitted_data_points() None[source]#

Initialize the all_datapoints variable in the session state.

initialize_submitted_slider() None[source]#

Initialize the slider for the submitted data.

load_user_parameters() Any[source]#

Read and process the parameter files provided by the user.

Returns:

The parsed parameters.

Return type:

Any

process_submission_form() None[source]#

Handle the form submission logic.

Returns:

Whether the submission was handled unsuccessfully.

Return type:

bool, optional

run_benchmarking_process()[source]#

Execute the benchmarking process and returns the results.

Returns:

The benchmarking results, all data points, and the input data frame.

Return type:

Tuple[pd.DataFrame, pd.DataFrame, pd.DataFrame]

save_intermediate_submission_data() None[source]#

Store intermediate and input data to the storage directory if available.

set_highlight_column_in_submitted_data() None[source]#

Initialize the highlight column in the data points.

show_submission_success_message(pr_url) None[source]#

Handle the UI updates and notifications after a successful submission.

Parameters:

pr_url (str) – The URL of the pull request.

submit_to_repository(params) str | None[source]#

Handle the submission process of the benchmark results to the ProteoBench repository.

Parameters:

params (ProteoBenchParameters) – The parameters for the submission.

Returns:

The URL of the pull request if the submission was successful.

Return type:

str, optional

update_parameters_submission_form(field, value) None[source]#

Update the session state dictionary with the specified field and value.

Parameters:
  • field (str) – The field to update.

  • value (Any) – The value to update the field with.

webinterface.pages.base_pages.quant.compare_dictionaries(old_dict, new_dict)[source]#

Generate a human-readable string describing differences between two dictionaries.

Parameters:
  • old_dict (dict) – The old dictionary.

  • new_dict (dict) – The new dictionary.

Returns:

The human-readable string describing the differences between the two dictionaries.

Return type:

str