From 39f92735ada50e24626c9781167ab4f994b00b3a Mon Sep 17 00:00:00 2001 From: niekdejonge Date: Sun, 26 Nov 2023 17:29:37 +0100 Subject: [PATCH] prospector --- ms2query/create_new_library/library_files_creator.py | 7 ++----- ms2query/ms2library.py | 4 +--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/ms2query/create_new_library/library_files_creator.py b/ms2query/create_new_library/library_files_creator.py index c2ebc4a9..64878c5f 100644 --- a/ms2query/create_new_library/library_files_creator.py +++ b/ms2query/create_new_library/library_files_creator.py @@ -5,12 +5,11 @@ import os from pathlib import Path -from typing import Dict, List, Union +from typing import List, Union import matchms.filtering as msfilters import numpy as np import pandas as pd from gensim.models import Word2Vec -from matchms import Spectrum from matchms.Spectrum import Spectrum from ms2deepscore import MS2DeepScore from ms2deepscore.models import load_model as load_ms2ds_model @@ -22,7 +21,6 @@ from ms2query.create_new_library.create_sqlite_database import ( add_dataframe_to_sqlite, fill_inchikeys_table, fill_spectrum_data_table, initialize_tables) -from ms2query.utils import return_non_existing_file_name class LibraryFilesCreator: @@ -75,8 +73,7 @@ def __init__(self, # pylint: disable=too-many-arguments if os.path.exists(sqlite_file_name): raise FileExistsError("The sqlite file already exists") - else: - self.sqlite_file_name = sqlite_file_name + self.sqlite_file_name = sqlite_file_name # Load in spec2vec model if os.path.exists(s2v_model_file_name): diff --git a/ms2query/ms2library.py b/ms2query/ms2library.py index c3c0dbc0..da726ad3 100644 --- a/ms2query/ms2library.py +++ b/ms2query/ms2library.py @@ -15,7 +15,7 @@ from ms2query.query_from_sqlite_database import SqliteLibrary from ms2query.results_table import ResultsTable from ms2query.utils import (SettingsRunMS2Query, column_names_for_output, - load_ms2query_model, load_pickled_file, + load_ms2query_model, predict_onnx_model, return_non_existing_file_name, select_files_in_directory) @@ -58,8 +58,6 @@ def __init__(self, ms2query_model_file_name: File location of ms2query model with .hdf5 extension. """ - # pylint: disable=too-many-arguments - # Load models and set file locations assert os.path.isfile(sqlite_file_name), f"The given sqlite file does not exist: {sqlite_file_name}" self.sqlite_library = SqliteLibrary(sqlite_file_name)