Skip to content

Commit

Permalink
Merge pull request #33 from mmzdouc/dev_mmz
Browse files Browse the repository at this point in the history
v0.3.2
  • Loading branch information
mmzdouc authored Jun 5, 2024
2 parents dfacf62 + 010d1ca commit 663150c
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 14 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions example_data/minimal.params.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"files": {
"peaktable": {
"filepath": "example_data/case_study_peak_table_quant_full.csv",
"format": "mzmine3",
"polarity": "positive"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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."
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -154,3 +154,5 @@ def run_analysis(self: Self):
"SKIP"
)
return

self.params.FragmentAnnParameters.module_passed = True
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 663150c

Please sign in to comment.