Skip to content

Commit

Permalink
#185 transfer GUI only supports best supported psm_readers
Browse files Browse the repository at this point in the history
  • Loading branch information
jalew188 committed Jul 16, 2024
1 parent 7fed088 commit 730be5d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
6 changes: 6 additions & 0 deletions peptdeep/webui/__init__.py
Original file line number Diff line number Diff line change
@@ -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"
21 changes: 12 additions & 9 deletions peptdeep/webui/transfer_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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(
Expand All @@ -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"],
Expand Down

0 comments on commit 730be5d

Please sign in to comment.