From 730be5dbbae95bba5ce4e5235e5778fb66e0d53f Mon Sep 17 00:00:00 2001 From: jalew188 Date: Tue, 16 Jul 2024 12:27:21 +0200 Subject: [PATCH] #185 transfer GUI only supports best supported psm_readers --- peptdeep/webui/__init__.py | 6 ++++++ peptdeep/webui/transfer_ui.py | 21 ++++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/peptdeep/webui/__init__.py b/peptdeep/webui/__init__.py index e69de29b..ec70a708 100644 --- a/peptdeep/webui/__init__.py +++ b/peptdeep/webui/__init__.py @@ -0,0 +1,6 @@ +# Starting the gui will raise by OpenMP in LLVM package +# `OMP: Error #15: Initializing libomp.dylib, but found libomp.dylib already initialized.` +# This is a quick fix, and it will only affect the GUI rather than the kernel. +import os + +os.environ["KMP_DUPLICATE_LIB_OK"] = "True" diff --git a/peptdeep/webui/transfer_ui.py b/peptdeep/webui/transfer_ui.py index 8541671d..8414cafe 100644 --- a/peptdeep/webui/transfer_ui.py +++ b/peptdeep/webui/transfer_ui.py @@ -6,6 +6,7 @@ from alphabase.yaml_utils import save_yaml from alphabase.constants.modification import MOD_DF +import alphabase.psm_reader from peptdeep.webui.server import queue_folder from peptdeep.webui.ui_utils import ( @@ -140,6 +141,15 @@ def _clear_user_mods(): def show(): + psm_type_to_ext_dict = { + "alphapept": ".ms_data.hdf", + "pfind": ".spectra", + "maxquant": "msms.txt", + "diann": "tsv", + "speclib_tsv": "tsv", + } + used_psm_types = list(psm_type_to_ext_dict.keys()) + st.write("# Transfer learning") model_output_folder = st.text_input( @@ -159,20 +169,13 @@ def show(): st_key="select_psm_type", default_type=global_ui_settings["model_mgr"]["transfer"]["psm_type"], monitor_files=global_ui_settings["model_mgr"]["transfer"]["psm_files"], - choices=global_ui_settings["model_mgr"]["transfer"]["psm_type_choices"], - index=global_ui_settings["model_mgr"]["transfer"]["psm_type_choices"].index( + choices=used_psm_types, + index=used_psm_types.index( global_ui_settings["model_mgr"]["transfer"]["psm_type"] ), ) global_ui_settings["model_mgr"]["transfer"]["psm_type"] = psm_type - psm_type_to_ext_dict = { - "alphapept": ".ms_data.hdf", - "pfind": ".spectra", - "maxquant": "msms.txt", - "diann": "tsv", - "speclib_tsv": "tsv", - } global_ui_settings["model_mgr"]["transfer"]["psm_type"] = psm_type select_files( global_ui_settings["model_mgr"]["transfer"]["psm_files"],