Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.4.0 #35

Merged
merged 2 commits into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

N/A

## [0.4.0] 15-06-2024

### Removed
- [Breaking change] Removed MS2Query de novo annotation after observation of process instability (unforeseen process termination by system with SIGKILL (9))

## [0.3.3] 06-06-2024

### Fixed
Expand Down
5 changes: 0 additions & 5 deletions example_data/case_study_parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,6 @@
"maximum_runtime": 200
}
},
"ms2query_annotation": {
"activate_module": true,
"score_cutoff": 0.7,
"maximum_runtime": 600
},
"as_kcb_matching": {
"modified_cosine": {
"activate_module": true,
Expand Down
51 changes: 0 additions & 51 deletions fermo_core/config/class_default_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ class DefaultPaths(BaseModel):
Attributes:
dirpath_ms2deepscore_pos: points towards default ms2deepscore dir
url_ms2deepscore_pos: the url to download the default ms2deepscore file
dirpath_ms2query_base: points towards default ms2query dir
dirpath_ms2query_pos: points towards default ms2query dir positive mode
dirpath_ms2query_neg: points towards default ms2query dir negative mode
url_ms2query_pos: urls to default ms2query files for positive ion mode
url_ms2query_neg: urls to default ms2query files for negative ion mode
dirpath_losses: point towards neutral loss dir
dirpath_frags: point towards fragment dir
library_mibig_pos: points towards mibig spectral library for positive ion mode
Expand All @@ -50,52 +45,6 @@ class DefaultPaths(BaseModel):
"https://zenodo.org/records/8274763/files/"
"ms2deepscore_positive_10k_1000_1000_1000_500.hdf5?download=1"
)
dirpath_ms2query_base: DirectoryPath = Path(__file__).parent.parent.joinpath(
"libraries/ms2query/"
)
dirpath_ms2query_pos: DirectoryPath = Path(__file__).parent.parent.joinpath(
"libraries/ms2query/pos"
)
dirpath_ms2query_neg: DirectoryPath = Path(__file__).parent.parent.joinpath(
"libraries/ms2query/neg"
)
url_ms2query_pos: tuple = (
"https://zenodo.org/records/10527997/files"
"/ALL_GNPS_210409_positive_processed_annotated_CF_NPC_classes.txt?download=1",
"https://zenodo.org/records/10527997/files"
"/library_GNPS_15_12_2021_ms2ds_embeddings.parquet?download=1",
"https://zenodo.org/records/10527997/files"
"/library_GNPS_15_12_2021_s2v_embeddings.parquet?download=1",
"https://zenodo.org/records/10527997/files/ms2ds_model_GNPS_15_12_2021.hdf5"
"?download=1",
"https://zenodo.org/records/10527997/files/ms2query_library.sqlite?download=1",
"https://zenodo.org/records/10527997/files/ms2query_random_forest_model.onnx"
"?download=1",
"https://zenodo.org/records/10527997/files/spec2vec_model_GNPS_15_12_2021"
".model?download=1",
"https://zenodo.org/records/10527997/files/spec2vec_model_GNPS_15_12_2021"
".model.syn1neg.npy?download=1",
"https://zenodo.org/records/10527997/files/spec2vec_model_GNPS_15_12_2021"
".model.wv.vectors.npy?download=1",
)
url_ms2query_neg: tuple = (
"https://zenodo.org/records/10528030/files/neg_GNPS_15_12_2021_ms2ds_model"
".hdf5?download=1",
"https://zenodo.org/records/10528030/files"
"/neg_GNPS_15_12_2021_ms2query_random_forest_model.onnx?download=1",
"https://zenodo.org/records/10528030/files"
"/neg_mode_GNPS_15_12_2021_ms2ds_embeddings.parquet?download=1",
"https://zenodo.org/records/10528030/files"
"/neg_mode_GNPS_15_12_2021_s2v_embeddings.parquet?download=1",
"https://zenodo.org/records/10528030/files"
"/neg_mode_spec2vec_model_GNPS_15_12_2021.model?download=1",
"https://zenodo.org/records/10528030/files"
"/neg_mode_spec2vec_model_GNPS_15_12_2021.model.syn1neg.npy?download=1",
"https://zenodo.org/records/10528030/files"
"/neg_mode_spec2vec_model_GNPS_15_12_2021.model.wv.vectors.npy?download=1",
"https://zenodo.org/records/10528030/files/negative_mode_15_12_2021.sqlite"
"?download=1",
)
dirpath_losses: DirectoryPath = Path(__file__).parent.parent.joinpath(
"libraries/loss_libs/"
)
Expand Down
25 changes: 0 additions & 25 deletions fermo_core/config/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -655,31 +655,6 @@
}
}
},
"ms2query_annotation": {
"title": "(Optional): settings for MS2Query annotation module. For non-specified parameters, default parameters will be used.",
"additionalProperties": false,
"type": "object",
"required": [
"activate_module"
],
"properties": {
"activate_module": {
"title": "Specifies whether this module should be run.",
"type": "boolean"
},
"maximum_runtime": {
"title": "(Optional): maximum running time of module, in seconds. A value of 0 (zero) indicates unlimited running time.",
"type": "integer",
"minimum": 0
},
"score_cutoff": {
"title": "(Optional): minimum score that must be reached to consider two MS/MS fragmentation spectra to be related.",
"type": "number",
"minimum": 0.1,
"maximum": 1.0
}
}
},
"as_kcb_matching": {
"title": "(Optional): settings for antiSMASH KnownClusterBlast results matching. Will be only executed if a 'as_results' directory was provided.",
"additionalProperties": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ def _eval_as_results_file() -> bool:
_eval_ms2query_results_file(),
self.run_ms2query_results_assignment,
),
(
self.params.Ms2QueryAnnotationParameters.activate_module,
self.run_ms2query_annotation,
),
(
_eval_as_results_file(),
self.run_as_kcb_cosine_annotation,
Expand Down Expand Up @@ -304,14 +300,6 @@ def run_fragment_annotation(self: Self):

def run_ms2query_results_assignment(self: Self):
"""Annotate Features from existing MS2Query results"""
if self.params.Ms2QueryAnnotationParameters.activate_module is True:
logger.warning(
f"'AnnotationManager': both an MS2Query result file and instructions "
f"for running the MS2Query algorithm were provided. In this case, "
f"the existing MS2Query results file "
f"'{self.params.MS2QueryResultsParameters.filepath.name}' takes "
f"precedence. "
)

logger.info(
"'AnnotationManager': started annotation from existing MS2Query results."
Expand Down Expand Up @@ -340,40 +328,6 @@ def run_ms2query_results_assignment(self: Self):
"'AnnotationManager': completed annotation from existing MS2Query results."
)

def run_ms2query_annotation(self: Self):
"""Perform annotation of feature MS2 using ms2query - run algorithm"""
if self.params.MS2QueryResultsParameters is not None:
logger.warning(
f"'AnnotationManager': both an MS2Query result file and instructions "
f"for running the MS2Query algorithm were provided. In this case, "
f"the existing MS2Query results file "
f"'{self.params.MS2QueryResultsParameters.filepath.name}' takes "
f"precedence. "
)
logger.warning("'AnnotationManager': MS2QueryAnnotator - SKIP ")
return

logger.info("'AnnotationManager': started annotation using MS2Query")

try:
ms2query_annotator = MS2QueryAnnotator(
params=self.params,
features=self.features,
active_features=self.stats.active_features,
cutoff=self.params.Ms2QueryAnnotationParameters.score_cutoff,
)
ms2query_annotator.run_ms2query()
self.features = ms2query_annotator.return_features()
self.params.Ms2QueryAnnotationParameters.module_passed = True
except Exception as e:
logger.error(str(e))
logger.error(
"'AnnotationManager': Error during running of MS2QueryAnnotator - SKIP"
)
return

logger.info("'AnnotationManager': completed annotation using MS2Query")

def run_as_kcb_cosine_annotation(self: Self):
"""Match features against a antiSMASH knownclusterblast-derived library.

Expand Down
Loading
Loading