masster 0.3.7__tar.gz → 0.3.8__tar.gz

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.

Potentially problematic release.


This version of masster might be problematic. Click here for more details.

Files changed (80) hide show
  1. {masster-0.3.7 → masster-0.3.8}/PKG-INFO +1 -1
  2. {masster-0.3.7 → masster-0.3.8}/pyproject.toml +1 -1
  3. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/defaults/find_features_def.py +108 -0
  4. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/processing.py +34 -0
  5. {masster-0.3.7 → masster-0.3.8}/src/masster/study/study.py +19 -0
  6. {masster-0.3.7 → masster-0.3.8}/uv.lock +1 -1
  7. {masster-0.3.7 → masster-0.3.8}/.github/workflows/publish.yml +0 -0
  8. {masster-0.3.7 → masster-0.3.8}/.github/workflows/security.yml +0 -0
  9. {masster-0.3.7 → masster-0.3.8}/.github/workflows/test.yml +0 -0
  10. {masster-0.3.7 → masster-0.3.8}/.gitignore +0 -0
  11. {masster-0.3.7 → masster-0.3.8}/.pre-commit-config.yaml +0 -0
  12. {masster-0.3.7 → masster-0.3.8}/LICENSE +0 -0
  13. {masster-0.3.7 → masster-0.3.8}/Makefile +0 -0
  14. {masster-0.3.7 → masster-0.3.8}/README.md +0 -0
  15. {masster-0.3.7 → masster-0.3.8}/TESTING.md +0 -0
  16. {masster-0.3.7 → masster-0.3.8}/demo/example_batch_process.py +0 -0
  17. {masster-0.3.7 → masster-0.3.8}/demo/example_sample_process.py +0 -0
  18. {masster-0.3.7 → masster-0.3.8}/src/masster/__init__.py +0 -0
  19. {masster-0.3.7 → masster-0.3.8}/src/masster/_version.py +0 -0
  20. {masster-0.3.7 → masster-0.3.8}/src/masster/chromatogram.py +0 -0
  21. {masster-0.3.7 → masster-0.3.8}/src/masster/data/examples/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.featureXML +0 -0
  22. {masster-0.3.7 → masster-0.3.8}/src/masster/data/examples/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.mzML +0 -0
  23. {masster-0.3.7 → masster-0.3.8}/src/masster/data/examples/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.sample5 +0 -0
  24. {masster-0.3.7 → masster-0.3.8}/src/masster/data/examples/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.timeseries.data +0 -0
  25. {masster-0.3.7 → masster-0.3.8}/src/masster/data/examples/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.wiff +0 -0
  26. {masster-0.3.7 → masster-0.3.8}/src/masster/data/examples/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.wiff.scan +0 -0
  27. {masster-0.3.7 → masster-0.3.8}/src/masster/data/examples/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.wiff2 +0 -0
  28. {masster-0.3.7 → masster-0.3.8}/src/masster/logger.py +0 -0
  29. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/__init__.py +0 -0
  30. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/defaults/__init__.py +0 -0
  31. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/defaults/find_adducts_def.py +0 -0
  32. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/defaults/find_ms2_def.py +0 -0
  33. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/defaults/get_spectrum_def.py +0 -0
  34. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/defaults/sample_def.py +0 -0
  35. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/h5.py +0 -0
  36. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/helpers.py +0 -0
  37. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/lib.py +0 -0
  38. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/load.py +0 -0
  39. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/parameters.py +0 -0
  40. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/plot.py +0 -0
  41. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/quant.py +0 -0
  42. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/sample.py +0 -0
  43. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/sample5_schema.json +0 -0
  44. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/save.py +0 -0
  45. {masster-0.3.7 → masster-0.3.8}/src/masster/sample/sciex.py +0 -0
  46. {masster-0.3.7 → masster-0.3.8}/src/masster/spectrum.py +0 -0
  47. {masster-0.3.7 → masster-0.3.8}/src/masster/study/__init__.py +0 -0
  48. {masster-0.3.7 → masster-0.3.8}/src/masster/study/defaults/__init__.py +0 -0
  49. {masster-0.3.7 → masster-0.3.8}/src/masster/study/defaults/align_def.py +0 -0
  50. {masster-0.3.7 → masster-0.3.8}/src/masster/study/defaults/export_def.py +0 -0
  51. {masster-0.3.7 → masster-0.3.8}/src/masster/study/defaults/fill_chrom_def.py +0 -0
  52. {masster-0.3.7 → masster-0.3.8}/src/masster/study/defaults/fill_def.py +0 -0
  53. {masster-0.3.7 → masster-0.3.8}/src/masster/study/defaults/find_consensus_def.py +0 -0
  54. {masster-0.3.7 → masster-0.3.8}/src/masster/study/defaults/find_ms2_def.py +0 -0
  55. {masster-0.3.7 → masster-0.3.8}/src/masster/study/defaults/integrate_chrom_def.py +0 -0
  56. {masster-0.3.7 → masster-0.3.8}/src/masster/study/defaults/integrate_def.py +0 -0
  57. {masster-0.3.7 → masster-0.3.8}/src/masster/study/defaults/merge_def.py +0 -0
  58. {masster-0.3.7 → masster-0.3.8}/src/masster/study/defaults/study_def.py +0 -0
  59. {masster-0.3.7 → masster-0.3.8}/src/masster/study/export.py +0 -0
  60. {masster-0.3.7 → masster-0.3.8}/src/masster/study/h5.py +0 -0
  61. {masster-0.3.7 → masster-0.3.8}/src/masster/study/helpers.py +0 -0
  62. {masster-0.3.7 → masster-0.3.8}/src/masster/study/helpers_optimized.py +0 -0
  63. {masster-0.3.7 → masster-0.3.8}/src/masster/study/load.py +0 -0
  64. {masster-0.3.7 → masster-0.3.8}/src/masster/study/parameters.py +0 -0
  65. {masster-0.3.7 → masster-0.3.8}/src/masster/study/plot.py +0 -0
  66. {masster-0.3.7 → masster-0.3.8}/src/masster/study/processing.py +0 -0
  67. {masster-0.3.7 → masster-0.3.8}/src/masster/study/save.py +0 -0
  68. {masster-0.3.7 → masster-0.3.8}/src/masster/study/study5_schema.json +0 -0
  69. {masster-0.3.7 → masster-0.3.8}/tests/conftest.py +0 -0
  70. {masster-0.3.7 → masster-0.3.8}/tests/test_chromatogram.py +0 -0
  71. {masster-0.3.7 → masster-0.3.8}/tests/test_defaults.py +0 -0
  72. {masster-0.3.7 → masster-0.3.8}/tests/test_imports.py +0 -0
  73. {masster-0.3.7 → masster-0.3.8}/tests/test_integration.py +0 -0
  74. {masster-0.3.7 → masster-0.3.8}/tests/test_logger.py +0 -0
  75. {masster-0.3.7 → masster-0.3.8}/tests/test_parameters.py +0 -0
  76. {masster-0.3.7 → masster-0.3.8}/tests/test_sample.py +0 -0
  77. {masster-0.3.7 → masster-0.3.8}/tests/test_spectrum.py +0 -0
  78. {masster-0.3.7 → masster-0.3.8}/tests/test_study.py +0 -0
  79. {masster-0.3.7 → masster-0.3.8}/tests/test_version.py +0 -0
  80. {masster-0.3.7 → masster-0.3.8}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: masster
3
- Version: 0.3.7
3
+ Version: 0.3.8
4
4
  Summary: Mass spectrometry data analysis package
5
5
  Project-URL: homepage, https://github.com/zamboni-lab/masster
6
6
  Project-URL: repository, https://github.com/zamboni-lab/masster
@@ -1,7 +1,7 @@
1
1
 
2
2
  [project]
3
3
  name = "masster"
4
- version = "0.3.7"
4
+ version = "0.3.8"
5
5
  description = "Mass spectrometry data analysis package"
6
6
  authors = [
7
7
  { name = "Zamboni Lab" }
@@ -90,6 +90,30 @@ class find_features_defaults:
90
90
  eic_mz_tol: float = 0.01
91
91
  eic_rt_tol: float = 10.0
92
92
 
93
+ # Additional OpenMS FeatureFinderMetabo parameters
94
+ threads: int = 1
95
+ no_progress: bool = False
96
+ debug: bool = False
97
+ min_sample_rate: float = 0.5
98
+ min_trace_length: int = 5
99
+ min_fwhm: float = 1.0
100
+ max_fwhm: float = 60.0
101
+
102
+ # Additional Mass Trace Detection parameters
103
+ trace_termination_criterion: str = "outlier"
104
+ reestimate_mt_sd: bool = True
105
+ quant_method: str = "area"
106
+
107
+ # Additional Elution Peak Detection parameters
108
+ enabled: bool = True
109
+
110
+ # Additional Feature Finding parameters
111
+ local_rt_range: float = 10.0
112
+ local_mz_range: float = 6.5
113
+ charge_lower_bound: int = 1
114
+ charge_upper_bound: int = 3
115
+ report_smoothed_intensities: bool = False
116
+
93
117
  # Parameter metadata for validation and description
94
118
  _param_metadata: dict[str, dict[str, Any]] = field(
95
119
  default_factory=lambda: {
@@ -192,6 +216,90 @@ class find_features_defaults:
192
216
  "min_value": 1.0,
193
217
  "max_value": 60.0,
194
218
  },
219
+ "threads": {
220
+ "dtype": int,
221
+ "description": "Number of threads to use for parallel processing",
222
+ "min_value": 1,
223
+ "max_value": 64,
224
+ },
225
+ "no_progress": {
226
+ "dtype": bool,
227
+ "description": "Disable progress logging",
228
+ },
229
+ "debug": {
230
+ "dtype": bool,
231
+ "description": "Enable debug mode for detailed logging",
232
+ },
233
+ "min_sample_rate": {
234
+ "dtype": float,
235
+ "description": "Minimum sample rate for mass trace detection",
236
+ "min_value": 0.1,
237
+ "max_value": 1.0,
238
+ },
239
+ "min_trace_length": {
240
+ "dtype": int,
241
+ "description": "Minimum trace length in number of spectra",
242
+ "min_value": 2,
243
+ "max_value": 100,
244
+ },
245
+ "min_fwhm": {
246
+ "dtype": float,
247
+ "description": "Minimum full width at half maximum for peaks (seconds)",
248
+ "min_value": 0.1,
249
+ "max_value": 10.0,
250
+ },
251
+ "max_fwhm": {
252
+ "dtype": float,
253
+ "description": "Maximum full width at half maximum for peaks (seconds)",
254
+ "min_value": 1.0,
255
+ "max_value": 300.0,
256
+ },
257
+ "trace_termination_criterion": {
258
+ "dtype": str,
259
+ "description": "Criterion for mass trace termination",
260
+ "allowed_values": ["outlier", "sample_rate"],
261
+ },
262
+ "reestimate_mt_sd": {
263
+ "dtype": bool,
264
+ "description": "Whether to re-estimate mass trace standard deviation",
265
+ },
266
+ "quant_method": {
267
+ "dtype": str,
268
+ "description": "Quantification method for features",
269
+ "allowed_values": ["area", "height"],
270
+ },
271
+ "enabled": {
272
+ "dtype": bool,
273
+ "description": "Whether elution peak detection is enabled",
274
+ },
275
+ "local_rt_range": {
276
+ "dtype": float,
277
+ "description": "Local retention time range for feature finding (seconds)",
278
+ "min_value": 1.0,
279
+ "max_value": 100.0,
280
+ },
281
+ "local_mz_range": {
282
+ "dtype": float,
283
+ "description": "Local m/z range for feature finding (Da)",
284
+ "min_value": 1.0,
285
+ "max_value": 20.0,
286
+ },
287
+ "charge_lower_bound": {
288
+ "dtype": int,
289
+ "description": "Lower bound for charge state detection",
290
+ "min_value": 1,
291
+ "max_value": 10,
292
+ },
293
+ "charge_upper_bound": {
294
+ "dtype": int,
295
+ "description": "Upper bound for charge state detection",
296
+ "min_value": 1,
297
+ "max_value": 10,
298
+ },
299
+ "report_smoothed_intensities": {
300
+ "dtype": bool,
301
+ "description": "Whether to report smoothed intensities for features",
302
+ },
195
303
  },
196
304
  )
197
305
 
@@ -569,6 +569,16 @@ def find_features(self, **kwargs):
569
569
  else:
570
570
  self.logger.warning(f"Unknown parameter {key} ignored")
571
571
 
572
+ # Set global parameters
573
+ if params.get('threads') is not None:
574
+ oms.OpenMSConfig.setNumThreads(params['threads'])
575
+
576
+ # Set debug mode if enabled
577
+ if params.get('debug'):
578
+ oms.OpenMSConfig.setLogLevel(oms.LogType.DEBUG)
579
+ elif params.get('no_progress', False):
580
+ oms.OpenMSConfig.setLogLevel(oms.LogType.NONE)
581
+
572
582
  self.logger.info("Starting feature detection...")
573
583
  self.logger.debug(
574
584
  f"Parameters: chrom_fwhm={params.get('chrom_fwhm')}, noise={params.get('noise')}, tol_ppm={params.get('tol_ppm')}",
@@ -609,6 +619,13 @@ def find_features(self, **kwargs):
609
619
  int(params.get("trace_termination_outliers")),
610
620
  )
611
621
  mtd_par.setValue("chrom_peak_snr", float(params.get("chrom_peak_snr")))
622
+
623
+ # Additional MTD parameters
624
+ mtd_par.setValue("min_sample_rate", float(params.get("min_sample_rate")))
625
+ mtd_par.setValue("min_trace_length", int(params.get("min_trace_length")))
626
+ mtd_par.setValue("trace_termination_criterion", params.get("trace_termination_criterion"))
627
+ mtd_par.setValue("reestimate_mt_sd", "true" if params.get("reestimate_mt_sd") else "false")
628
+ mtd_par.setValue("quant_method", params.get("quant_method"))
612
629
 
613
630
  mtd.setParameters(mtd_par) # set the new parameters
614
631
  mtd.run(exp, mass_traces, 0) # run mass trace detection
@@ -627,6 +644,13 @@ def find_features(self, **kwargs):
627
644
  epd_par.setValue("masstrace_snr_filtering", "true")
628
645
  if params.get("mz_scoring_13C"):
629
646
  epd_par.setValue("mz_scoring_13C", "true")
647
+
648
+ # Additional EPD parameters
649
+ epd_par.setValue("enabled", "true" if params.get("enabled") else "false")
650
+
651
+ # Set min/max FWHM parameters
652
+ epd_par.setValue("min_fwhm", float(params.get("min_fwhm")))
653
+ epd_par.setValue("max_fwhm", float(params.get("max_fwhm")))
630
654
 
631
655
  epd.setParameters(epd_par)
632
656
  epd.detectPeaks(mass_traces, mass_traces_deconvol)
@@ -654,6 +678,16 @@ def find_features(self, **kwargs):
654
678
  "report_chromatograms",
655
679
  "true" if params.get("report_chromatograms") else "false",
656
680
  )
681
+
682
+ # Additional FFM parameters
683
+ ffm_par.setValue("local_rt_range", float(params.get("local_rt_range")))
684
+ ffm_par.setValue("local_mz_range", float(params.get("local_mz_range")))
685
+ ffm_par.setValue("charge_lower_bound", int(params.get("charge_lower_bound")))
686
+ ffm_par.setValue("charge_upper_bound", int(params.get("charge_upper_bound")))
687
+ ffm_par.setValue(
688
+ "report_smoothed_intensities",
689
+ "true" if params.get("report_smoothed_intensities") else "false",
690
+ )
657
691
 
658
692
  ffm.setParameters(ffm_par)
659
693
  self.logger.debug("Running feature finding with parameters:")
@@ -126,6 +126,12 @@ from masster.study.defaults.integrate_chrom_def import integrate_chrom_defaults
126
126
  from masster.study.defaults.integrate_def import integrate_defaults
127
127
  from masster.study.defaults.merge_def import merge_defaults
128
128
 
129
+ # Import sample defaults
130
+ from masster.sample.defaults.sample_def import sample_defaults
131
+ from masster.sample.defaults.find_features_def import find_features_defaults
132
+ from masster.sample.defaults.find_adducts_def import find_adducts_defaults
133
+ from masster.sample.defaults.get_spectrum_def import get_spectrum_defaults
134
+
129
135
 
130
136
  class Study:
131
137
  """
@@ -164,6 +170,19 @@ class Study:
164
170
  - `ddafile`: For individual sample processing before study-level analysis.
165
171
  - `StudyParameters`: For configuring study-specific parameters.
166
172
  """
173
+
174
+ # Defaults class attributes
175
+ study_defaults = study_defaults
176
+ sample_defaults = sample_defaults
177
+ find_features_defaults = find_features_defaults
178
+ find_adducts_defaults = find_adducts_defaults
179
+ find_ms2_defaults = find_ms2_defaults
180
+ get_spectrum_defaults = get_spectrum_defaults
181
+ export_mgf_defaults = export_mgf_defaults
182
+ align_defaults = align_defaults
183
+ merge_defaults = merge_defaults
184
+ integrate_defaults = integrate_defaults
185
+ integrate_chrom_defaults = integrate_chrom_defaults
167
186
 
168
187
  def __init__(
169
188
  self,
@@ -1315,7 +1315,7 @@ wheels = [
1315
1315
 
1316
1316
  [[package]]
1317
1317
  name = "masster"
1318
- version = "0.3.7"
1318
+ version = "0.3.8"
1319
1319
  source = { editable = "." }
1320
1320
  dependencies = [
1321
1321
  { name = "alphabase" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes