From fc22b581b6913240c4d623d85fc4f3d72d646153 Mon Sep 17 00:00:00 2001 From: RobbinBouwmeester Date: Fri, 15 Nov 2024 17:03:59 +0100 Subject: [PATCH] Show peptidoform DDA quant module --- webinterface/.streamlit/pages.toml | 4 + webinterface/pages/DDA_Quant_peptidoform.py | 84 +++++++++++++++++-- .../dda_quant_peptidoform_variables.py | 17 +++- 3 files changed, 96 insertions(+), 9 deletions(-) diff --git a/webinterface/.streamlit/pages.toml b/webinterface/.streamlit/pages.toml index c4b331a6..4c3688e4 100644 --- a/webinterface/.streamlit/pages.toml +++ b/webinterface/.streamlit/pages.toml @@ -6,6 +6,10 @@ name = "Home" path = "pages/DDA_Quant_ion.py" name = "DDA Quant Ion Level -BETA-" +[[pages]] +path = "pages/DDA_Quant_peptidoform.py" +name = "DDA Quant Peptidoform Level -BETA-" + [[pages]] path = "pages/DIA_Quant_ion.py" name = "DIA Quant Ion Level -BETA-" diff --git a/webinterface/pages/DDA_Quant_peptidoform.py b/webinterface/pages/DDA_Quant_peptidoform.py index 8c280c77..e65fb0b1 100644 --- a/webinterface/pages/DDA_Quant_peptidoform.py +++ b/webinterface/pages/DDA_Quant_peptidoform.py @@ -8,7 +8,9 @@ from pages.texts.generic_texts import WebpageTexts from proteobench.io.parsing.parse_settings_peptidoform import ParseSettingsBuilder -from proteobench.modules.dda_quant_peptidoform.dda_quant_peptidoform_module import DDAQuantPeptidoformModule +from proteobench.modules.dda_quant_peptidoform.dda_quant_peptidoform_module import ( + DDAQuantPeptidoformModule, +) class StreamlitUI: @@ -42,14 +44,82 @@ def _main_page(self) -> None: Sets up the main page layout for the Streamlit application. This includes the title, module descriptions, input forms, and configuration settings. """ - self.quant_uiobjects.create_text_header() - self.quant_uiobjects.create_main_submission_form() - self.quant_uiobjects.init_slider() + # Create tabs + ( + tab_results_all, + tab_submission_details, + tab_indepth_plots, + tab_results_new, + tab_public_submission, + ) = st.tabs( + [ + "Public Benchmark Runs", + "Submit New Data", + "Results In-Depth", + "Results New Data", + "Public Submission", + ] + ) + + with tab_results_all: + st.title(self.variables_dda_quant.texts.ShortMessages.title) + st.write( + f"The full description of the module is available [here]({self.variables_dda_quant.texts.ShortMessages.doc_url})" + ) + if self.variables_dda_quant.beta_warning: + st.warning( + "This module is in BETA phase. The figure presented below and the metrics calculation may change in the near future." + ) + self.quant_uiobjects.display_all_data_results_main() + + # Tab 2: Submission Details + with tab_submission_details: + st.title(self.variables_dda_quant.texts.ShortMessages.title) + st.write( + f"The full description of the module is available [here]({self.variables_dda_quant.texts.ShortMessages.doc_url})" + ) + if self.variables_dda_quant.beta_warning: + st.warning( + "This module is in BETA phase. The figure presented below and the metrics calculation may change in the near future." + ) + self.quant_uiobjects.display_submission_form() + + # Tab 2.5: in-depth plots current data + with tab_indepth_plots: + st.title(self.variables_dda_quant.texts.ShortMessages.title) + st.write( + f"The full description of the module is available [here]({self.variables_dda_quant.texts.ShortMessages.doc_url})" + ) + if self.variables_dda_quant.beta_warning: + st.warning( + "This module is in BETA phase. The figure presented below and the metrics calculation may change in the near future." + ) + self.quant_uiobjects.generate_current_data_plots(True) + + # Tab 3: Results (New Submissions) + with tab_results_new: + st.title(self.variables_dda_quant.texts.ShortMessages.title) + st.write( + f"The full description of the module is available [here]({self.variables_dda_quant.texts.ShortMessages.doc_url})" + ) + if self.variables_dda_quant.beta_warning: + st.warning( + "This module is in BETA phase. The figure presented below and the metrics calculation may change in the near future." + ) - if self.quant_uiobjects.variables_quant.fig_logfc in st.session_state: - self.quant_uiobjects.populate_results() + self.quant_uiobjects.display_all_data_results_submitted() - self.quant_uiobjects.create_results() + # Tab 4: Public Submission + with tab_public_submission: + st.title(self.variables_dda_quant.texts.ShortMessages.title) + st.write( + f"The full description of the module is available [here]({self.variables_dda_quant.texts.ShortMessages.doc_url})" + ) + if self.variables_dda_quant.beta_warning: + st.warning( + "This module is in BETA phase. The figure presented below and the metrics calculation may change in the near future." + ) + self.quant_uiobjects.display_public_submission_ui() if __name__ == "__main__": diff --git a/webinterface/pages/pages_variables/dda_quant_peptidoform_variables.py b/webinterface/pages/pages_variables/dda_quant_peptidoform_variables.py index ddcf62eb..f84dc2c9 100644 --- a/webinterface/pages/pages_variables/dda_quant_peptidoform_variables.py +++ b/webinterface/pages/pages_variables/dda_quant_peptidoform_variables.py @@ -21,13 +21,26 @@ class VariablesDDAQuant: comments_submission_uuid: str = "comments_submission_uuid_dda_quant_peptidoform" check_submission_uuid: str = "check_submission_uuid_dda_quant_peptidoform" meta_data_text: str = "comments_for_submission_dda_quant_peptidoform" - check_submission: str = "heck_submission_dda_quant_peptidoform" + check_submission: str = "check_submission_dda_quant_peptidoform" button_submission_uuid: str = "button_submission_uuid_dda_quant_peptidoform" df_head: str = "df_head_dda_quant_peptidoform" placeholder_fig_compare: str = "placeholder_fig_compare_dda_quant_peptidoform" + + all_datapoints_submitted: str = "all_datapoints_submitted_dda_quant_peptidoform" + placeholder_table_submitted: str = "placeholder_table_submitted_dda_quant_peptidoform" + placeholder_slider_submitted: str = "placeholder_slider_submitted_dda_quant_peptidoform" + highlight_list_submitted: List[str] = field(default_factory=list) + selectbox_id_submitted_uuid: str = "selectbox_id_submitted_dda_quant_peptidoform" + selectbox_id_uuid: str = "selectbox_id_dda_quant_peptidoform" + slider_id_submitted_uuid: str = "slider_id_submitted_dda_quant_peptidoform" + slider_id_uuid: str = "slider_id_dda_quant_peptidoform" + download_selector_id_uuid: str = "download_selector_id_dda_quant_peptidoform" + table_id_uuid: str = "table_id_dda_quant_peptidoform" + placeholder_table: str = "placeholder_table_dda_quant_peptidoform" placeholder_slider: str = "placeholder_slider_dda_quant_peptidoform" - placeholder_downloads_container: str = "placeholder_downloads_container" + + placeholder_downloads_container: str = "placeholder_downloads_container_dda_quant_peptidoform" highlight_list: List[str] = field(default_factory=list) first_new_plot: bool = True default_val_slider: int = 3