Skip to content

Commit

Permalink
Merge pull request #63 from compomics/minor-fixes
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
RalfG authored Apr 19, 2022
2 parents 605971c + f7221e9 commit d7677eb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ To install a newer version of MS²Rescore, run `upgrade-gui-windows.bat`.

### GUI

Run `start-gui-windows.bat` or run `python -m ms2rescore.gui` in your terminal to start
the graphical user interface. Most common settings can be configured through the UI.
For some advanced settings, see [Configuration file](#configuration-file).
Run `start-gui-windows.bat` or run `ms2rescore-gui` or
`python -m ms2rescore.gui`in your terminal to start the graphical user
interface. Most common settings can be configured through the
UI. For some advanced settings, see [Configuration file](#configuration-file).

<img src="img/gui-screenshot.png" height=480 />

Expand Down
21 changes: 12 additions & 9 deletions ms2rescore/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@

import argparse
import ast
from distutils.command.config import config
from email.policy import default
import importlib.resources as pkg_resources
import json
import logging
import pprint
import multiprocessing
import pprint
import sys
import warnings
from pathlib import Path

from gooey import Gooey, GooeyParser, local_resource_path
from ms2pip.ms2pipC import MODELS as ms2pip_models

from ms2rescore import MS2ReScore, package_data
import ms2rescore.package_data.img as img_module
from ms2rescore._exceptions import MS2RescoreError

try:
import importlib.resources as pkg_resources
except ImportError:
import importlib_resources as pkg_resources
import ms2rescore.package_data.img as img_module


logger = logging.getLogger(__name__)
Expand All @@ -42,9 +39,15 @@ class MS2RescoreGUIError(MS2RescoreError):
tabbed_groups=True,
requires_shell=False,
default_size=(760, 720),
target=None if getattr(sys, 'frozen', False) else "ms2rescore-gui"
)
def main():
"""Run MS²Rescore."""
# Disable warnings in GUI
warnings.filterwarnings('ignore', category=DeprecationWarning)
warnings.filterwarnings('ignore', category=FutureWarning)
warnings.filterwarnings('ignore', category=UserWarning)

conf = _parse_arguments().__dict__
conf = parse_settings(conf)
rescore = MS2ReScore(parse_cli_args=False, configuration=conf, set_logger=True)
Expand Down
2 changes: 1 addition & 1 deletion ms2rescore/percolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def _infer_modification_label_style(self) -> str:
"""Infer modification label style (e.g. unimod_accession or mass shift)."""
# TODO: What happens if there are no mods? Crashes?
modified_peptides = self.df[
self.df["Peptide"].str.contains(r"\[([^\[^\]]*)\]", regex=True)
self.df["Peptide"].str.contains(r"\[[^\[^\]]*\]", regex=True)
]["Peptide"]
if (
modified_peptides.str.extract(r"\[([^\[^\]]*)\]", expand=False)
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ def get_readme():
include_package_data=True,
entry_points={"console_scripts": [
"ms2rescore=ms2rescore.__main__:main",
"ms2rescore-gui=ms2rescore.gui:main",
]},
python_requires=">=3.7",
install_requires=[
"importlib-resources;python_version<'3.7'",
"numpy>=1.16.0,<2",
"pandas>=0.24.0,<2",
"scikit-learn>=0.20.0,<1",
"scikit-learn>=0.20.0,<2",
"scipy>=1.2.0,<2",
"tqdm>=4.31.0,<5",
"pyteomics>=4.1.0,<5",
Expand Down

0 comments on commit d7677eb

Please sign in to comment.