masster 0.4.0__py3-none-any.whl → 0.4.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. masster/__init__.py +8 -8
  2. masster/_version.py +1 -1
  3. masster/chromatogram.py +3 -9
  4. masster/data/libs/README.md +1 -1
  5. masster/data/libs/ccm.csv +120 -120
  6. masster/data/libs/ccm.py +116 -62
  7. masster/data/libs/central_carbon_README.md +1 -1
  8. masster/data/libs/urine.py +161 -65
  9. masster/data/libs/urine_metabolites.csv +4693 -4693
  10. masster/data/wiff/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.mzML +2 -2
  11. masster/logger.py +43 -78
  12. masster/sample/__init__.py +1 -1
  13. masster/sample/adducts.py +264 -338
  14. masster/sample/defaults/find_adducts_def.py +8 -21
  15. masster/sample/defaults/find_features_def.py +1 -6
  16. masster/sample/defaults/get_spectrum_def.py +1 -5
  17. masster/sample/defaults/sample_def.py +1 -5
  18. masster/sample/h5.py +282 -561
  19. masster/sample/helpers.py +75 -131
  20. masster/sample/lib.py +17 -42
  21. masster/sample/load.py +17 -31
  22. masster/sample/parameters.py +2 -6
  23. masster/sample/plot.py +27 -88
  24. masster/sample/processing.py +87 -117
  25. masster/sample/quant.py +51 -57
  26. masster/sample/sample.py +90 -103
  27. masster/sample/sample5_schema.json +44 -44
  28. masster/sample/save.py +12 -35
  29. masster/sample/sciex.py +19 -66
  30. masster/spectrum.py +20 -58
  31. masster/study/__init__.py +1 -1
  32. masster/study/defaults/align_def.py +1 -5
  33. masster/study/defaults/fill_chrom_def.py +1 -5
  34. masster/study/defaults/fill_def.py +1 -5
  35. masster/study/defaults/integrate_chrom_def.py +1 -5
  36. masster/study/defaults/integrate_def.py +1 -5
  37. masster/study/defaults/study_def.py +25 -58
  38. masster/study/export.py +207 -233
  39. masster/study/h5.py +136 -470
  40. masster/study/helpers.py +202 -495
  41. masster/study/helpers_optimized.py +13 -40
  42. masster/study/id.py +110 -213
  43. masster/study/load.py +143 -230
  44. masster/study/plot.py +257 -518
  45. masster/study/processing.py +257 -469
  46. masster/study/save.py +5 -15
  47. masster/study/study.py +276 -379
  48. masster/study/study5_schema.json +96 -96
  49. {masster-0.4.0.dist-info → masster-0.4.1.dist-info}/METADATA +1 -1
  50. masster-0.4.1.dist-info/RECORD +67 -0
  51. masster-0.4.0.dist-info/RECORD +0 -67
  52. {masster-0.4.0.dist-info → masster-0.4.1.dist-info}/WHEEL +0 -0
  53. {masster-0.4.0.dist-info → masster-0.4.1.dist-info}/entry_points.txt +0 -0
  54. {masster-0.4.0.dist-info → masster-0.4.1.dist-info}/licenses/LICENSE +0 -0
masster/study/save.py CHANGED
@@ -9,7 +9,7 @@ import pyopenms as oms
9
9
 
10
10
  from tqdm import tqdm
11
11
 
12
- from master.sample.sample import Sample
12
+ from masster.sample.sample import Sample
13
13
 
14
14
 
15
15
  def save(self, filename=None, add_timestamp=True, compress=False):
@@ -48,14 +48,8 @@ def save(self, filename=None, add_timestamp=True, compress=False):
48
48
  # Log file size information for performance monitoring
49
49
  if hasattr(self, "features_df") and not self.features_df.is_empty():
50
50
  feature_count = len(self.features_df)
51
- sample_count = (
52
- len(self.samples_df)
53
- if hasattr(self, "samples_df") and not self.samples_df.is_empty()
54
- else 0
55
- )
56
- self.logger.info(
57
- f"Saving study with {sample_count} samples and {feature_count} features to {filename}",
58
- )
51
+ sample_count = len(self.samples_df) if hasattr(self, "samples_df") and not self.samples_df.is_empty() else 0
52
+ self.logger.info(f"Saving study with {sample_count} samples and {feature_count} features to {filename}")
59
53
 
60
54
  # Use compressed mode for large datasets
61
55
  if compress:
@@ -127,9 +121,7 @@ def save_samples(self, samples=None):
127
121
  if sample_path.endswith(".sample5"):
128
122
  # If sample_path is a .sample5 file, save featureXML in the same directory
129
123
  featurexml_filename = sample_path.replace(".sample5", ".featureXML")
130
- self.logger.debug(
131
- f"Saving featureXML alongside .sample5 file: {featurexml_filename}",
132
- )
124
+ self.logger.debug(f"Saving featureXML alongside .sample5 file: {featurexml_filename}")
133
125
  else:
134
126
  # Fallback to study folder or current directory (original behavior)
135
127
  if self.folder is not None:
@@ -142,9 +134,7 @@ def save_samples(self, samples=None):
142
134
  os.getcwd(),
143
135
  sample_name + ".featureXML",
144
136
  )
145
- self.logger.debug(
146
- f"Saving featureXML to default location: {featurexml_filename}",
147
- )
137
+ self.logger.debug(f"Saving featureXML to default location: {featurexml_filename}")
148
138
 
149
139
  fh = oms.FeatureXMLFile()
150
140
  if sample_index is not None and sample_index < len(self.features_maps):