masster 0.3.7__py3-none-any.whl → 0.3.9__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.
Potentially problematic release.
This version of masster might be problematic. Click here for more details.
- masster/sample/defaults/find_features_def.py +108 -0
- masster/sample/processing.py +40 -0
- masster/study/study.py +19 -0
- {masster-0.3.7.dist-info → masster-0.3.9.dist-info}/METADATA +1 -1
- {masster-0.3.7.dist-info → masster-0.3.9.dist-info}/RECORD +8 -8
- {masster-0.3.7.dist-info → masster-0.3.9.dist-info}/WHEEL +0 -0
- {masster-0.3.7.dist-info → masster-0.3.9.dist-info}/entry_points.txt +0 -0
- {masster-0.3.7.dist-info → masster-0.3.9.dist-info}/licenses/LICENSE +0 -0
|
@@ -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
|
|
masster/sample/processing.py
CHANGED
|
@@ -569,6 +569,22 @@ 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 hasattr(params, 'threads') and params.threads is not None:
|
|
574
|
+
try:
|
|
575
|
+
# Try setting via OpenMP environment variable first (newer approach)
|
|
576
|
+
import os
|
|
577
|
+
os.environ['OMP_NUM_THREADS'] = str(params.threads)
|
|
578
|
+
self.logger.debug(f"Set thread count to {params.threads} via OMP_NUM_THREADS")
|
|
579
|
+
except Exception:
|
|
580
|
+
self.logger.warning(f"Could not set thread count to {params.threads} - using default")
|
|
581
|
+
|
|
582
|
+
# Set debug mode if enabled
|
|
583
|
+
if hasattr(params, 'debug') and params.debug:
|
|
584
|
+
self.logger.debug("Debug mode enabled")
|
|
585
|
+
elif hasattr(params, 'no_progress') and params.no_progress:
|
|
586
|
+
self.logger.debug("No progress mode enabled")
|
|
587
|
+
|
|
572
588
|
self.logger.info("Starting feature detection...")
|
|
573
589
|
self.logger.debug(
|
|
574
590
|
f"Parameters: chrom_fwhm={params.get('chrom_fwhm')}, noise={params.get('noise')}, tol_ppm={params.get('tol_ppm')}",
|
|
@@ -609,6 +625,13 @@ def find_features(self, **kwargs):
|
|
|
609
625
|
int(params.get("trace_termination_outliers")),
|
|
610
626
|
)
|
|
611
627
|
mtd_par.setValue("chrom_peak_snr", float(params.get("chrom_peak_snr")))
|
|
628
|
+
|
|
629
|
+
# Additional MTD parameters
|
|
630
|
+
mtd_par.setValue("min_sample_rate", float(params.get("min_sample_rate")))
|
|
631
|
+
mtd_par.setValue("min_trace_length", float(params.get("min_trace_length")))
|
|
632
|
+
mtd_par.setValue("trace_termination_criterion", params.get("trace_termination_criterion"))
|
|
633
|
+
mtd_par.setValue("reestimate_mt_sd", "true" if params.get("reestimate_mt_sd") else "false")
|
|
634
|
+
mtd_par.setValue("quant_method", params.get("quant_method"))
|
|
612
635
|
|
|
613
636
|
mtd.setParameters(mtd_par) # set the new parameters
|
|
614
637
|
mtd.run(exp, mass_traces, 0) # run mass trace detection
|
|
@@ -627,6 +650,13 @@ def find_features(self, **kwargs):
|
|
|
627
650
|
epd_par.setValue("masstrace_snr_filtering", "true")
|
|
628
651
|
if params.get("mz_scoring_13C"):
|
|
629
652
|
epd_par.setValue("mz_scoring_13C", "true")
|
|
653
|
+
|
|
654
|
+
# Additional EPD parameters
|
|
655
|
+
epd_par.setValue("enabled", "true" if params.get("enabled") else "false")
|
|
656
|
+
|
|
657
|
+
# Set min/max FWHM parameters
|
|
658
|
+
epd_par.setValue("min_fwhm", float(params.get("min_fwhm")))
|
|
659
|
+
epd_par.setValue("max_fwhm", float(params.get("max_fwhm")))
|
|
630
660
|
|
|
631
661
|
epd.setParameters(epd_par)
|
|
632
662
|
epd.detectPeaks(mass_traces, mass_traces_deconvol)
|
|
@@ -654,6 +684,16 @@ def find_features(self, **kwargs):
|
|
|
654
684
|
"report_chromatograms",
|
|
655
685
|
"true" if params.get("report_chromatograms") else "false",
|
|
656
686
|
)
|
|
687
|
+
|
|
688
|
+
# Additional FFM parameters
|
|
689
|
+
ffm_par.setValue("local_rt_range", float(params.get("local_rt_range")))
|
|
690
|
+
ffm_par.setValue("local_mz_range", float(params.get("local_mz_range")))
|
|
691
|
+
ffm_par.setValue("charge_lower_bound", int(params.get("charge_lower_bound")))
|
|
692
|
+
ffm_par.setValue("charge_upper_bound", int(params.get("charge_upper_bound")))
|
|
693
|
+
ffm_par.setValue(
|
|
694
|
+
"report_smoothed_intensities",
|
|
695
|
+
"true" if params.get("report_smoothed_intensities") else "false",
|
|
696
|
+
)
|
|
657
697
|
|
|
658
698
|
ffm.setParameters(ffm_par)
|
|
659
699
|
self.logger.debug("Running feature finding with parameters:")
|
masster/study/study.py
CHANGED
|
@@ -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,
|
|
@@ -17,7 +17,7 @@ masster/sample/lib.py,sha256=9r2XlF_BaJ4WNAsQo8hElieRLwsAv0yrbYq4DJ0iVOM,33496
|
|
|
17
17
|
masster/sample/load.py,sha256=y-KUJ2nCFX_06FHPUOh-CzRRvaTx14xNcXoL19bU8qY,47562
|
|
18
18
|
masster/sample/parameters.py,sha256=Gg2KcuNbV_wZ_Wwv93QlM5J19ji0oSIvZLPV1NoBmq0,4456
|
|
19
19
|
masster/sample/plot.py,sha256=uUJAd2qxhVG6Ev2hLuU406zFA2TDkkBz2MG12P9fLik,71449
|
|
20
|
-
masster/sample/processing.py,sha256=
|
|
20
|
+
masster/sample/processing.py,sha256=AZdqEzOu4D_0B-3KCrvEr3wZ67taWpfZqFAIHeslf3s,60265
|
|
21
21
|
masster/sample/quant.py,sha256=tHNjvUFTdehKR31BXBZnVsBxMD9XJHgaltITOjr71uE,7562
|
|
22
22
|
masster/sample/sample.py,sha256=ekS-qBfzx3_Lb2KLMu-s90owRlk3lK4616mmiAiiHTc,16726
|
|
23
23
|
masster/sample/sample5_schema.json,sha256=3SPFQZH4SooLYUt_lW-PCOE9rHnl56Vhc2XG-r1nyEQ,3586
|
|
@@ -25,7 +25,7 @@ masster/sample/save.py,sha256=o9eFSqqr7KYwvCD3gOJt_nZ4h3pkflWqs0n0oSLM-sU,31970
|
|
|
25
25
|
masster/sample/sciex.py,sha256=q6PdcjCtV2PWnJiXuvfISu09zjkaTR_fvHvWN9OvOcM,46870
|
|
26
26
|
masster/sample/defaults/__init__.py,sha256=A09AOP44cxD_oYohyt7XFUho0zndRcrzVD4DUaGnKH4,447
|
|
27
27
|
masster/sample/defaults/find_adducts_def.py,sha256=6CcGRlz4VeosoBT_W0bkR1Kjj11Rq3QvuuOnkizIZyk,11630
|
|
28
|
-
masster/sample/defaults/find_features_def.py,sha256=
|
|
28
|
+
masster/sample/defaults/find_features_def.py,sha256=Qh-_HT2uPn7xdG7p-j0nOvS2kMammxQYyD0Hl8L_Zcw,17924
|
|
29
29
|
masster/sample/defaults/find_ms2_def.py,sha256=KTELMAnioGLYbhzAwOgK14TZqboPEvzeBN0HC-v0Z5A,9872
|
|
30
30
|
masster/sample/defaults/get_spectrum_def.py,sha256=o62p31PhGd-LiIkTOzKQhwPtnO2AtQDHcPu-O-YoQPs,11460
|
|
31
31
|
masster/sample/defaults/sample_def.py,sha256=t8vrb8MoBBsFQcRzlaT0-q0hAssOxWO7vhCAJU3_THs,14068
|
|
@@ -39,7 +39,7 @@ masster/study/parameters.py,sha256=0elaF7YspTsB7qyajWAbRNL2VfKlGz5GJLifmO8IGkk,3
|
|
|
39
39
|
masster/study/plot.py,sha256=NW31XdM9Bf5wNvIAs-56AIoPA8VLTqBzr6qJInfZmhc,25159
|
|
40
40
|
masster/study/processing.py,sha256=BQuSBO7O8iTlCjXenECyg0_PAsPF1NNiUllypuemPZI,46101
|
|
41
41
|
masster/study/save.py,sha256=bcRADWTvhTER9WRkT9zNU5mDUPQZkZB2cuJwpRsYmrM,6589
|
|
42
|
-
masster/study/study.py,sha256=
|
|
42
|
+
masster/study/study.py,sha256=4jItwNGUZUv9uDwAcfFYT3GRh-ACJ1bddSGQaiQs6YM,29002
|
|
43
43
|
masster/study/study5_schema.json,sha256=A_xDPzB97xt2EFeQsX9j8Ut7yC4_DS7BZ24ucotOXIw,5103
|
|
44
44
|
masster/study/defaults/__init__.py,sha256=m3Z5KXGqsTdh7GjYzZoENERt39yRg0ceVRV1DeCt1P0,610
|
|
45
45
|
masster/study/defaults/align_def.py,sha256=9aM7kY4_ecgG8QC6v57AASiRRkPxwG77r3-PlQ2BkHk,9139
|
|
@@ -52,8 +52,8 @@ masster/study/defaults/integrate_chrom_def.py,sha256=Rih3-vat7fHGVfIvRitjNJJI3zL
|
|
|
52
52
|
masster/study/defaults/integrate_def.py,sha256=Vf4SAzdBfnsSZ3IRaF0qZvWu3gMDPHdgPfMYoPKeWv8,7246
|
|
53
53
|
masster/study/defaults/merge_def.py,sha256=EBsKE3hsAkTEzN9dpdRD5W3_suTKy_WZ_96rwS0uBuE,8572
|
|
54
54
|
masster/study/defaults/study_def.py,sha256=hj8bYtEPwzdowC95yfyoCFt6fZkQePLjpJtmpNz9Z5M,9533
|
|
55
|
-
masster-0.3.
|
|
56
|
-
masster-0.3.
|
|
57
|
-
masster-0.3.
|
|
58
|
-
masster-0.3.
|
|
59
|
-
masster-0.3.
|
|
55
|
+
masster-0.3.9.dist-info/METADATA,sha256=FXWOvACxtEV0Svzws7jY8fKf4v6xmgzZ-Drgc2O_n-0,44292
|
|
56
|
+
masster-0.3.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
57
|
+
masster-0.3.9.dist-info/entry_points.txt,sha256=ZHguQ_vPmdbpqq2uGtmEOLJfgP-DQ1T0c07Lxh30wc8,58
|
|
58
|
+
masster-0.3.9.dist-info/licenses/LICENSE,sha256=bx5iLIKjgAdYQ7sISn7DsfHRKkoCUm1154sJJKhgqnU,35184
|
|
59
|
+
masster-0.3.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|