Skip to content

Commit

Permalink
Merge pull request #186 from MannLabs/185-fix-psm-reader-register
Browse files Browse the repository at this point in the history
#185 transfer GUI only supports best supported psm_readers
  • Loading branch information
jalew188 authored Aug 5, 2024
2 parents 0154483 + d6b701e commit 9e50434
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 35 deletions.
24 changes: 8 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# User defined:
peptdeep/logs
*.DS_Store
*sandbox*
*installed_models*
*.last_checked*
*mono_crash.*.blob

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -128,19 +136,3 @@ dmypy.json

# Pyre type checker
.pyre/

# User defined:
peptdeep/logs
*.DS_Store
*sandbox*
*installed_models*
*.last_checked*

# nbdev2
*.gitattributes
_docs*
# *_quarto.yml
# *sidebar.yml
*_proc*
# .gitconfig is now autogenerated
.gitconfig
1 change: 0 additions & 1 deletion peptdeep/_modidx.py

This file was deleted.

3 changes: 1 addition & 2 deletions peptdeep/constants/default_settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,9 @@ library:
max_precursor_mz: 2000.0
decoy: None
decoy_choices:
- protein_reverse
- None
- pseudo_reverse
- diann
- None
max_frag_charge: 2
frag_types:
- b
Expand Down
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"
2 changes: 0 additions & 2 deletions peptdeep/webui/rescore_ui.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import streamlit as st
import pandas as pd
import os
import time

from .ui_utils import files_in_folder_pandas
from peptdeep.settings import global_settings
Expand Down
1 change: 0 additions & 1 deletion peptdeep/webui/server.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import time
import os
import sys
import shutil
import multiprocessing as mp

Expand Down
1 change: 0 additions & 1 deletion peptdeep/webui/server_ui.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import streamlit as st
import os
import psutil
import time

from alphabase.yaml_utils import load_yaml

Expand Down
3 changes: 1 addition & 2 deletions peptdeep/webui/settings_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
from peptdeep.settings import (
update_settings,
add_user_defined_modifications,
global_settings,
)

from peptdeep.settings import global_settings

global_ui_settings = global_settings


Expand Down
22 changes: 12 additions & 10 deletions peptdeep/webui/transfer_ui.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import streamlit as st
import pandas as pd
import os
import time
from datetime import datetime

from alphabase.yaml_utils import save_yaml
Expand Down Expand Up @@ -140,6 +139,16 @@ 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",
"msfragger_pepxml": "pepxml",
}
used_psm_types = list(psm_type_to_ext_dict.keys())

st.write("# Transfer learning")

model_output_folder = st.text_input(
Expand All @@ -159,20 +168,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 9e50434

Please sign in to comment.