diff --git a/CHANGELOG.md b/CHANGELOG.md index 352e7ba..5eb70a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm N/A +## [0.3.2] 05-06-2024 + +### Fixed + +- Corrected erroneous assignment of 'True' to 'module_passed' for FragmentAnnotator and NeutralLossAnnotator if no MS/MS information was provided + ## [0.3.1] 05-06-2024 ### Changed diff --git a/example_data/minimal.params.json b/example_data/minimal.params.json new file mode 100644 index 0000000..00ef67e --- /dev/null +++ b/example_data/minimal.params.json @@ -0,0 +1,9 @@ +{ + "files": { + "peaktable": { + "filepath": "example_data/case_study_peak_table_quant_full.csv", + "format": "mzmine3", + "polarity": "positive" + } + } +} \ No newline at end of file diff --git a/fermo_core/data_analysis/annotation_manager/class_adduct_annotator.py b/fermo_core/data_analysis/annotation_manager/class_adduct_annotator.py index 6bf5fa2..ace9b9e 100644 --- a/fermo_core/data_analysis/annotation_manager/class_adduct_annotator.py +++ b/fermo_core/data_analysis/annotation_manager/class_adduct_annotator.py @@ -78,7 +78,7 @@ def run_analysis(self: Self): for s_name in self.stats.samples: self.annotate_adducts_pos(s_name) else: - logger.warning( + logger.info( "'AnnotationManager/AdductAnnotator': negative ion mode detected. " "Attempt to annotate for negative ion mode adducts." ) diff --git a/fermo_core/data_analysis/annotation_manager/class_annotation_manager.py b/fermo_core/data_analysis/annotation_manager/class_annotation_manager.py index 361e538..0fc4a96 100644 --- a/fermo_core/data_analysis/annotation_manager/class_annotation_manager.py +++ b/fermo_core/data_analysis/annotation_manager/class_annotation_manager.py @@ -268,8 +268,7 @@ def run_neutral_loss_annotation(self: Self): samples=self.samples, ) neutralloss_annotator.run_analysis() - self.features = neutralloss_annotator.return_features() - self.params.NeutralLossParameters.module_passed = True + self.features, self.params = neutralloss_annotator.return_attributes() except Exception as e: logger.error(str(e)) logger.error( @@ -292,8 +291,7 @@ def run_fragment_annotation(self: Self): samples=self.samples, ) fragment_annotator.run_analysis() - self.features = fragment_annotator.return_features() - self.params.FragmentAnnParameters.module_passed = True + self.features, self.params = fragment_annotator.return_attributes() except Exception as e: logger.error(str(e)) logger.error( diff --git a/fermo_core/data_analysis/annotation_manager/class_fragment_annotator.py b/fermo_core/data_analysis/annotation_manager/class_fragment_annotator.py index 0fd230c..e00f48b 100644 --- a/fermo_core/data_analysis/annotation_manager/class_fragment_annotator.py +++ b/fermo_core/data_analysis/annotation_manager/class_fragment_annotator.py @@ -57,13 +57,13 @@ class FragmentAnnotator(BaseModel): samples: Repository frags: CharFragments = CharFragments() - def return_features(self: Self) -> Repository: - """Returns modified Feature objects in Repository object instance + def return_attributes(self: Self) -> tuple[Repository, ParameterManager]: + """Returns modified object instance Returns: - Modified Feature Repository object. + Modified Feature Repository and ParameterManager objects. """ - return self.features + return self.features, self.params @staticmethod def add_annotation(feature: Feature) -> Feature: @@ -154,3 +154,5 @@ def run_analysis(self: Self): "SKIP" ) return + + self.params.FragmentAnnParameters.module_passed = True diff --git a/fermo_core/data_analysis/annotation_manager/class_neutral_loss_annotator.py b/fermo_core/data_analysis/annotation_manager/class_neutral_loss_annotator.py index 6bc1d28..0aedb97 100644 --- a/fermo_core/data_analysis/annotation_manager/class_neutral_loss_annotator.py +++ b/fermo_core/data_analysis/annotation_manager/class_neutral_loss_annotator.py @@ -57,13 +57,13 @@ class NeutralLossAnnotator(BaseModel): samples: Repository mass: NeutralLosses = NeutralLosses() - def return_features(self: Self) -> Repository: - """Returns modified Feature objects in Repository object instance + def return_attributes(self: Self) -> tuple[Repository, ParameterManager]: + """Returns modified attributes Returns: - Modified Feature Repository object. + Modified Feature and Params object """ - return self.features + return self.features, self.params def annotate_feature_neg(self: Self, f_id: int): """Annotate neutral losses of feature and store data in General Feature @@ -325,3 +325,5 @@ def run_analysis(self: Self): ) for f_id in self.stats.active_features: self.annotate_feature_neg(f_id) + + self.params.NeutralLossParameters.module_passed = True diff --git a/pyproject.toml b/pyproject.toml index 9ea45da..86424d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "fermo_core" -version = "0.3.1" +version = "0.3.2" description = "Data processing/analysis functionality of metabolomics dashboard FERMO" readme = "README.md" requires-python = ">=3.11,<3.12"