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
@@ -54,15 +54,13 @@ class find_adducts_defaults:
54
54
  charge_span_max: int = 2
55
55
 
56
56
  # Retention time constraints (in seconds - final confirmed unit)
57
- retention_max_diff: float = 1.0 # 1 second - precise RT grouping
57
+ retention_max_diff: float = 1.0 # 1 second - precise RT grouping
58
58
  retention_max_diff_local: float = 1.0 # 1 second - precise RT grouping
59
-
59
+
60
60
  # Mass tolerance constraints
61
- mass_max_diff: float = (
62
- 0.01 # 0.01 Da - strict mass tolerance for chemical specificity
63
- )
61
+ mass_max_diff: float = 0.01 # 0.01 Da - strict mass tolerance for chemical specificity
64
62
  unit: str = "Da" # Mass tolerance unit: "Da" or "ppm"
65
-
63
+
66
64
  # Probability filtering
67
65
  min_probability: float = 0.03 # Minimum probability to consider adducts (filters low-probability adducts)
68
66
 
@@ -183,7 +181,7 @@ class find_adducts_defaults:
183
181
  return all(isinstance(item, str) for item in value)
184
182
  else:
185
183
  return False
186
-
184
+
187
185
  # Handle unit parameter
188
186
  if param_name == "unit":
189
187
  if isinstance(value, str):
@@ -350,27 +348,16 @@ class find_adducts_defaults:
350
348
 
351
349
  if adducts is None or adducts in ["pos", "positive"]:
352
350
  return [
353
- "+H:1:0.65",
354
- "+Na:1:0.15",
355
- "+NH4:1:0.15",
356
- "+K:1:0.05",
357
- "-H2O:0:0.15",
351
+ "+H:1:0.65", "+Na:1:0.15", "+NH4:1:0.15", "+K:1:0.05", "-H2O:0:0.15"
358
352
  ]
359
353
  elif adducts in ["neg", "negative"]:
360
354
  return [
361
- "-H:-1:0.9",
362
- "+Cl:-1:0.1",
363
- "+CH2O2:0:0.15",
364
- "-H2O:0:0.15",
355
+ "-H:-1:0.9", "+Cl:-1:0.1", "+CH2O2:0:0.15", "-H2O:0:0.15"
365
356
  ]
366
357
  elif isinstance(adducts, list):
367
358
  return adducts
368
359
  else:
369
360
  # Fallback to positive mode if unexpected format
370
361
  return [
371
- "+H:1:0.65",
372
- "+Na:1:0.15",
373
- "+NH4:1:0.15",
374
- "+K:1:0.05",
375
- "-H2O:0:0.2",
362
+ "+H:1:0.65", "+Na:1:0.15", "+NH4:1:0.15", "+K:1:0.05", "-H2O:0:0.2"
376
363
  ]
@@ -210,12 +210,7 @@ class find_features_defaults:
210
210
  "dtype": str,
211
211
  "description": "Isotope filtering model",
212
212
  "default": "metabolites (5% RMS)",
213
- "allowed_values": [
214
- "metabolites (2% RMS)",
215
- "metabolites (5% RMS)",
216
- "peptides",
217
- "none",
218
- ],
213
+ "allowed_values": ["metabolites (2% RMS)", "metabolites (5% RMS)", "peptides", "none"],
219
214
  },
220
215
  "threads": {
221
216
  "dtype": int,
@@ -222,11 +222,7 @@ class get_spectrum_defaults:
222
222
  expected_dtype = self._param_metadata[param_name]["dtype"]
223
223
 
224
224
  # Handle optional types
225
- if (
226
- isinstance(expected_dtype, str)
227
- and expected_dtype.startswith("Optional")
228
- and value is not None
229
- ):
225
+ if isinstance(expected_dtype, str) and expected_dtype.startswith("Optional") and value is not None:
230
226
  if "int" in expected_dtype and not isinstance(value, int):
231
227
  try:
232
228
  value = int(value)
@@ -297,11 +297,7 @@ class sample_defaults:
297
297
  expected_dtype = self._param_metadata[param_name]["dtype"]
298
298
 
299
299
  # Handle optional types
300
- if (
301
- isinstance(expected_dtype, str)
302
- and expected_dtype.startswith("Optional")
303
- and value is not None
304
- ):
300
+ if isinstance(expected_dtype, str) and expected_dtype.startswith("Optional") and value is not None:
305
301
  if "int" in expected_dtype and not isinstance(value, int):
306
302
  try:
307
303
  value = int(value)