From 75402516e31c6069f5411ff22ab4ddfa6ec1e2ba Mon Sep 17 00:00:00 2001 From: "Mitja M. Zdouc" Date: Sun, 26 May 2024 19:02:14 +0200 Subject: [PATCH] Fixed bug in SummaryWriter --- CHANGELOG.md | 6 ++ .../input_output/class_summary_writer.py | 65 ++++++++++--------- pyproject.toml | 2 +- 3 files changed, 43 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57d8ab2..d88916e 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.2.1] 26-05-2024 + +### Fixed + +- Fixed bug in "SummaryWriter": implemented error catching. + ## [0.2.0] 26-05-2024 ### Changed diff --git a/fermo_core/input_output/class_summary_writer.py b/fermo_core/input_output/class_summary_writer.py index dccd012..a462a22 100644 --- a/fermo_core/input_output/class_summary_writer.py +++ b/fermo_core/input_output/class_summary_writer.py @@ -133,9 +133,9 @@ def summarize_featurefilteringparameters(self: Self): self.summary.append( f"Molecular features were filtered and only retained if they were " f"inside the relative area range of " - f"'{self.params.FeatureFilteringParameters.filter_rel_int_range[0]}" + f"'{self.params.FeatureFilteringParameters.filter_rel_area_range[0]}" f"-" - f"{self.params.FeatureFilteringParameters.filter_rel_int_range[1]}'" + f"{self.params.FeatureFilteringParameters.filter_rel_area_range[1]}'" f" in at least one sample (relative to the feature with the " f"highest area in the sample)." ) @@ -349,30 +349,37 @@ def summarize_askcbdeepscorematchingparams(self: Self): def assemble_summary(self: Self): """Call methods to assemble the summary file""" - logger.debug("'SummaryWriter': Started summary: files") - self.summarize_peaktableparameters() - self.summarize_msmsparameters() - self.summarize_phenotypeparameters() - self.summarize_groupmetadataparameters() - self.summarize_speclibparameters() - self.summarize_ms2queryresultsparameters() - self.summarize_asresultsparameters() - logger.debug("'SummaryWriter': Completed summary: files") - logger.debug("'SummaryWriter': Started summary: analysis modules") - self.summarize_featurefilteringparameters() - self.summarize_adductannotationparameters() - self.summarize_neutrallossparameters() - self.summarize_fragmentannparameters() - self.summarize_specsimnetworkcosineparameters() - self.summarize_specsimnetworkdeepscoreparameters() - self.summarize_blankassignmentparameters() - self.summarize_groupfactassignmentparameters() - self.summarize_phenoqualassgnparams() - self.summarize_phenoquantpercentassgnparams() - self.summarize_phenoquantconcassgnparams() - self.summarize_spectrallibmatchingcosineparameters() - self.summarize_spectrallibmatchingdeepscoreparameters() - self.summarize_ms2queryannotationparameters() - self.summarize_askcbcosinematchingparams() - self.summarize_askcbdeepscorematchingparams() - logger.debug("'SummaryWriter': Completed summary: analysis modules") + try: + logger.debug("'SummaryWriter': Started summary: files") + self.summarize_peaktableparameters() + self.summarize_msmsparameters() + self.summarize_phenotypeparameters() + self.summarize_groupmetadataparameters() + self.summarize_speclibparameters() + self.summarize_ms2queryresultsparameters() + self.summarize_asresultsparameters() + logger.debug("'SummaryWriter': Completed summary: files") + logger.debug("'SummaryWriter': Started summary: analysis modules") + self.summarize_featurefilteringparameters() + self.summarize_adductannotationparameters() + self.summarize_neutrallossparameters() + self.summarize_fragmentannparameters() + self.summarize_specsimnetworkcosineparameters() + self.summarize_specsimnetworkdeepscoreparameters() + self.summarize_blankassignmentparameters() + self.summarize_groupfactassignmentparameters() + self.summarize_phenoqualassgnparams() + self.summarize_phenoquantpercentassgnparams() + self.summarize_phenoquantconcassgnparams() + self.summarize_spectrallibmatchingcosineparameters() + self.summarize_spectrallibmatchingdeepscoreparameters() + self.summarize_ms2queryannotationparameters() + self.summarize_askcbcosinematchingparams() + self.summarize_askcbdeepscorematchingparams() + logger.debug("'SummaryWriter': Completed summary: analysis modules") + except Exception as e: + logger.error(str(e)) + logger.error( + "SummaryWriter: error occurred during writing of summary. " + "Write steps until error occurred." + ) diff --git a/pyproject.toml b/pyproject.toml index f0bf7f6..a9979d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "fermo_core" -version = "0.2.0" +version = "0.2.1" description = "Data processing/analysis functionality of metabolomics dashboard FERMO" readme = "README.md" requires-python = ">=3.11,<3.12"