masster 0.3.9__py3-none-any.whl → 0.3.11__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/docs/SCX_API_Documentation.md +0 -0
- masster/docs/SCX_DLL_Analysis.md +0 -0
- masster/logger.py +92 -78
- masster/sample/defaults/find_features_def.py +90 -94
- masster/sample/defaults/sample_def.py +15 -0
- masster/sample/h5.py +2 -2
- masster/sample/helpers.py +137 -136
- masster/sample/lib.py +11 -11
- masster/sample/load.py +13 -9
- masster/sample/plot.py +167 -60
- masster/sample/processing.py +150 -153
- masster/sample/sample.py +4 -4
- masster/sample/sample5_schema.json +62 -62
- masster/sample/save.py +16 -13
- masster/sample/sciex.py +187 -176
- masster/study/defaults/align_def.py +224 -6
- masster/study/defaults/fill_chrom_def.py +1 -5
- masster/study/defaults/integrate_chrom_def.py +1 -5
- masster/study/defaults/study_def.py +2 -2
- masster/study/export.py +144 -131
- masster/study/h5.py +193 -133
- masster/study/helpers.py +293 -245
- masster/study/helpers_optimized.py +99 -57
- masster/study/load.py +51 -25
- masster/study/plot.py +453 -17
- masster/study/processing.py +197 -123
- masster/study/save.py +7 -7
- masster/study/study.py +97 -88
- masster/study/study5_schema.json +82 -82
- {masster-0.3.9.dist-info → masster-0.3.11.dist-info}/METADATA +1 -1
- {masster-0.3.9.dist-info → masster-0.3.11.dist-info}/RECORD +34 -32
- {masster-0.3.9.dist-info → masster-0.3.11.dist-info}/WHEEL +0 -0
- {masster-0.3.9.dist-info → masster-0.3.11.dist-info}/entry_points.txt +0 -0
- {masster-0.3.9.dist-info → masster-0.3.11.dist-info}/licenses/LICENSE +0 -0
|
File without changes
|
|
File without changes
|
masster/logger.py
CHANGED
|
@@ -86,40 +86,44 @@ class MassterLogger:
|
|
|
86
86
|
|
|
87
87
|
# Loguru-style colors for different log levels
|
|
88
88
|
level_colors = {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
"TRACE": "\x1b[34m", # blue
|
|
90
|
+
"DEBUG": "\x1b[36m", # cyan
|
|
91
|
+
"INFO": "\x1b[37m", # white
|
|
92
|
+
"SUCCESS": "\x1b[32m", # green
|
|
93
|
+
"WARNING": "\x1b[33m", # yellow
|
|
94
|
+
"ERROR": "\x1b[31m", # red
|
|
95
|
+
"CRITICAL": "\x1b[35m", # magenta
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
level_str = record.levelname.ljust(8)
|
|
99
|
-
level_color = level_colors.get(record.levelname,
|
|
99
|
+
level_color = level_colors.get(record.levelname, "\x1b[37m") # default white
|
|
100
100
|
label_part = self.label + " | " if self.label else ""
|
|
101
|
-
|
|
101
|
+
|
|
102
102
|
# For DEBUG and TRACE levels, add module/location information
|
|
103
103
|
location_info = ""
|
|
104
|
-
if record.levelname in [
|
|
104
|
+
if record.levelname in ["TRACE"]:
|
|
105
105
|
# Use caller information if available (from extra), otherwise fall back to record info
|
|
106
|
-
if hasattr(record,
|
|
107
|
-
module_name = record.caller_module.split(
|
|
106
|
+
if hasattr(record, "caller_module"):
|
|
107
|
+
module_name = record.caller_module.split(".")[-1] if record.caller_module else "unknown"
|
|
108
108
|
line_no = record.caller_lineno
|
|
109
109
|
func_name = record.caller_funcname
|
|
110
110
|
else:
|
|
111
|
-
module_name = record.module if hasattr(record,
|
|
111
|
+
module_name = record.module if hasattr(record, "module") else "unknown"
|
|
112
112
|
line_no = record.lineno
|
|
113
113
|
func_name = record.funcName
|
|
114
|
-
location_info =
|
|
115
|
-
|
|
114
|
+
location_info = (
|
|
115
|
+
f"\x1b[90m{module_name}:{func_name}:{line_no}\x1b[0m | " # dim gray for location info
|
|
116
|
+
)
|
|
117
|
+
|
|
116
118
|
# Loguru-style format: <white>timestamp</white> | <level>LEVEL</level> | <location> | <cyan>label</cyan> - <level>message</level>
|
|
117
|
-
return (
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
return (
|
|
120
|
+
f"\x1b[37m{timestamp}\x1b[0m | " # white timestamp
|
|
121
|
+
f"{level_color}{level_str}\x1b[0m | " # colored level
|
|
122
|
+
f"{location_info}" # location info for DEBUG/TRACE
|
|
123
|
+
f"{level_color}{label_part}\x1b[0m" # colored label
|
|
124
|
+
f"{level_color}{record.getMessage()}\x1b[0m"
|
|
125
|
+
) # colored message
|
|
126
|
+
|
|
123
127
|
self.handler.setFormatter(massterFormatter(self.label))
|
|
124
128
|
self.logger_instance.addHandler(self.handler)
|
|
125
129
|
|
|
@@ -150,40 +154,44 @@ class MassterLogger:
|
|
|
150
154
|
|
|
151
155
|
# Loguru-style colors for different log levels
|
|
152
156
|
level_colors = {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
157
|
+
"TRACE": "\x1b[34m", # blue
|
|
158
|
+
"DEBUG": "\x1b[36m", # cyan
|
|
159
|
+
"INFO": "\x1b[37m", # white
|
|
160
|
+
"SUCCESS": "\x1b[32m", # green
|
|
161
|
+
"WARNING": "\x1b[33m", # yellow
|
|
162
|
+
"ERROR": "\x1b[31m", # red
|
|
163
|
+
"CRITICAL": "\x1b[35m", # magenta
|
|
160
164
|
}
|
|
161
165
|
|
|
162
166
|
level_str = record.levelname.ljust(8)
|
|
163
|
-
level_color = level_colors.get(record.levelname,
|
|
167
|
+
level_color = level_colors.get(record.levelname, "\x1b[37m") # default white
|
|
164
168
|
label_part = self.label + " | " if self.label else ""
|
|
165
|
-
|
|
169
|
+
|
|
166
170
|
# For DEBUG and TRACE levels, add module/location information
|
|
167
171
|
location_info = ""
|
|
168
|
-
if record.levelname in [
|
|
172
|
+
if record.levelname in ["TRACE"]:
|
|
169
173
|
# Use caller information if available (from extra), otherwise fall back to record info
|
|
170
|
-
if hasattr(record,
|
|
171
|
-
module_name = record.caller_module.split(
|
|
174
|
+
if hasattr(record, "caller_module"):
|
|
175
|
+
module_name = record.caller_module.split(".")[-1] if record.caller_module else "unknown"
|
|
172
176
|
line_no = record.caller_lineno
|
|
173
177
|
func_name = record.caller_funcname
|
|
174
178
|
else:
|
|
175
|
-
module_name = record.module if hasattr(record,
|
|
179
|
+
module_name = record.module if hasattr(record, "module") else "unknown"
|
|
176
180
|
line_no = record.lineno
|
|
177
181
|
func_name = record.funcName
|
|
178
|
-
location_info =
|
|
179
|
-
|
|
182
|
+
location_info = (
|
|
183
|
+
f"\x1b[90m{module_name}:{func_name}:{line_no}\x1b[0m | " # dim gray for location info
|
|
184
|
+
)
|
|
185
|
+
|
|
180
186
|
# Loguru-style format: <white>timestamp</white> | <level>LEVEL</level> | <location> | <cyan>label</cyan> - <level>message</level>
|
|
181
|
-
return (
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
+
return (
|
|
188
|
+
f"\x1b[37m{timestamp}\x1b[0m | " # white timestamp
|
|
189
|
+
f"{level_color}{level_str}\x1b[0m | " # colored level
|
|
190
|
+
f"{location_info}" # location info for DEBUG/TRACE
|
|
191
|
+
f"{level_color}{label_part}\x1b[0m" # colored label
|
|
192
|
+
f"{level_color}{record.getMessage()}\x1b[0m"
|
|
193
|
+
) # colored message
|
|
194
|
+
|
|
187
195
|
self.handler.setFormatter(massterFormatter(self.label))
|
|
188
196
|
|
|
189
197
|
def update_sink(self, sink: Any):
|
|
@@ -210,40 +218,44 @@ class MassterLogger:
|
|
|
210
218
|
|
|
211
219
|
# Loguru-style colors for different log levels
|
|
212
220
|
level_colors = {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
221
|
+
"TRACE": "\x1b[34m", # blue
|
|
222
|
+
"DEBUG": "\x1b[36m", # cyan
|
|
223
|
+
"INFO": "\x1b[37m", # white
|
|
224
|
+
"SUCCESS": "\x1b[32m", # green
|
|
225
|
+
"WARNING": "\x1b[33m", # yellow
|
|
226
|
+
"ERROR": "\x1b[31m", # red
|
|
227
|
+
"CRITICAL": "\x1b[35m", # magenta
|
|
220
228
|
}
|
|
221
229
|
|
|
222
230
|
level_str = record.levelname.ljust(8)
|
|
223
|
-
level_color = level_colors.get(record.levelname,
|
|
231
|
+
level_color = level_colors.get(record.levelname, "\x1b[37m") # default white
|
|
224
232
|
label_part = self.label + " | " if self.label else ""
|
|
225
|
-
|
|
233
|
+
|
|
226
234
|
# For DEBUG and TRACE levels, add module/location information
|
|
227
235
|
location_info = ""
|
|
228
|
-
if record.levelname in [
|
|
236
|
+
if record.levelname in ["TRACE"]:
|
|
229
237
|
# Use caller information if available (from extra), otherwise fall back to record info
|
|
230
|
-
if hasattr(record,
|
|
231
|
-
module_name = record.caller_module.split(
|
|
238
|
+
if hasattr(record, "caller_module"):
|
|
239
|
+
module_name = record.caller_module.split(".")[-1] if record.caller_module else "unknown"
|
|
232
240
|
line_no = record.caller_lineno
|
|
233
241
|
func_name = record.caller_funcname
|
|
234
242
|
else:
|
|
235
243
|
module_name = record.module
|
|
236
244
|
line_no = record.lineno
|
|
237
245
|
func_name = record.funcName
|
|
238
|
-
location_info =
|
|
239
|
-
|
|
246
|
+
location_info = (
|
|
247
|
+
f"\x1b[90m{module_name}:{func_name}:{line_no}\x1b[0m | " # dim gray for location info
|
|
248
|
+
)
|
|
249
|
+
|
|
240
250
|
# Loguru-style format: <white>timestamp</white> | <level>LEVEL</level> | <location> | <cyan>label</cyan> - <level>message</level>
|
|
241
|
-
return (
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
251
|
+
return (
|
|
252
|
+
f"\x1b[37m{timestamp}\x1b[0m | " # white timestamp
|
|
253
|
+
f"{level_color}{level_str}\x1b[0m | " # colored level
|
|
254
|
+
f"{location_info}" # location info for DEBUG/TRACE
|
|
255
|
+
f"{level_color}{label_part}\x1b[0m" # colored label
|
|
256
|
+
f"{level_color}{record.getMessage()}\x1b[0m"
|
|
257
|
+
) # colored message
|
|
258
|
+
|
|
247
259
|
self.handler.setFormatter(massterFormatter(self.label))
|
|
248
260
|
self.logger_instance.addHandler(self.handler)
|
|
249
261
|
|
|
@@ -252,36 +264,38 @@ class MassterLogger:
|
|
|
252
264
|
"""Log a TRACE level message (mapped to DEBUG)."""
|
|
253
265
|
# Get caller frame information (skip this method and go to actual caller)
|
|
254
266
|
import inspect
|
|
267
|
+
|
|
255
268
|
frame = inspect.currentframe().f_back
|
|
256
|
-
|
|
269
|
+
|
|
257
270
|
# Add caller information as extra parameters
|
|
258
|
-
extra = kwargs.get(
|
|
271
|
+
extra = kwargs.get("extra", {})
|
|
259
272
|
extra.update({
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
273
|
+
"caller_module": frame.f_globals.get("__name__", "unknown"),
|
|
274
|
+
"caller_filename": frame.f_code.co_filename,
|
|
275
|
+
"caller_lineno": frame.f_lineno,
|
|
276
|
+
"caller_funcname": frame.f_code.co_name,
|
|
264
277
|
})
|
|
265
|
-
kwargs[
|
|
266
|
-
|
|
278
|
+
kwargs["extra"] = extra
|
|
279
|
+
|
|
267
280
|
self.logger_instance.debug(message, *args, **kwargs)
|
|
268
281
|
|
|
269
282
|
def debug(self, message: str, *args, **kwargs):
|
|
270
283
|
"""Log a DEBUG level message."""
|
|
271
284
|
# Get caller frame information (skip this method and go to actual caller)
|
|
272
285
|
import inspect
|
|
286
|
+
|
|
273
287
|
frame = inspect.currentframe().f_back
|
|
274
|
-
|
|
288
|
+
|
|
275
289
|
# Add caller information as extra parameters
|
|
276
|
-
extra = kwargs.get(
|
|
290
|
+
extra = kwargs.get("extra", {})
|
|
277
291
|
extra.update({
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
292
|
+
"caller_module": frame.f_globals.get("__name__", "unknown"),
|
|
293
|
+
"caller_filename": frame.f_code.co_filename,
|
|
294
|
+
"caller_lineno": frame.f_lineno,
|
|
295
|
+
"caller_funcname": frame.f_code.co_name,
|
|
282
296
|
})
|
|
283
|
-
kwargs[
|
|
284
|
-
|
|
297
|
+
kwargs["extra"] = extra
|
|
298
|
+
|
|
285
299
|
self.logger_instance.debug(message, *args, **kwargs)
|
|
286
300
|
|
|
287
301
|
def info(self, message: str, *args, **kwargs):
|
|
@@ -17,102 +17,104 @@ from typing import Any
|
|
|
17
17
|
|
|
18
18
|
@dataclass
|
|
19
19
|
class find_features_defaults:
|
|
20
|
+
"""Configuration defaults for the feature-finding pipeline.
|
|
21
|
+
|
|
22
|
+
This dataclass centralizes parameters used by the `find_features()` routine
|
|
23
|
+
(mass-trace detection, elution-peak detection and feature assembly). The
|
|
24
|
+
purpose of this docstring is to explain the role and impact of the main
|
|
25
|
+
parameters users commonly tune.
|
|
26
|
+
|
|
27
|
+
Main parameters (what they mean, units and guidance):
|
|
28
|
+
|
|
29
|
+
- chrom_fwhm (float, seconds):
|
|
30
|
+
Expected chromatographic peak full-width at half-maximum (FWHM) in
|
|
31
|
+
seconds. This value informs the peak detection algorithms about the
|
|
32
|
+
typical temporal width of chromatographic peaks. It is used for
|
|
33
|
+
smoothing, window sizes when searching for local maxima and when
|
|
34
|
+
calculating RT-based tolerances. Use a value that matches your LC
|
|
35
|
+
method: smaller values for sharp, fast chromatography and larger values
|
|
36
|
+
for broader peaks. Default: 1.0 s.
|
|
37
|
+
|
|
38
|
+
- noise (float, intensity units):
|
|
39
|
+
Intensity threshold used to filter out low-intensity signals before
|
|
40
|
+
mass-trace and peak detection. Points with intensity below this
|
|
41
|
+
threshold are treated as background and typically ignored. Raising
|
|
42
|
+
`noise` reduces false positives from background fluctuations but may
|
|
43
|
+
remove low-abundance true peaks; lowering it increases sensitivity at
|
|
44
|
+
the cost of more noise. Default: 200.0 (instrument-dependent).
|
|
45
|
+
|
|
46
|
+
- chrom_peak_snr (float, unitless):
|
|
47
|
+
Minimum signal-to-noise ratio required to accept a detected
|
|
48
|
+
chromatographic peak. SNR is typically computed as peak height
|
|
49
|
+
(or crest intensity) divided by an estimate of local noise. A higher
|
|
50
|
+
`chrom_peak_snr` makes detection stricter (fewer false positives),
|
|
51
|
+
while a lower value makes detection more permissive (more low-SNR
|
|
52
|
+
peaks accepted). Typical values range from ~3 (relaxed) to >10
|
|
53
|
+
(stringent). Default: 10.0.
|
|
54
|
+
|
|
55
|
+
- isotope_filtering_model (str):
|
|
56
|
+
Isotope filtering model to use ('metabolites (2% RMS)', 'metabolites (5% RMS)',
|
|
57
|
+
'peptides', 'none'). Default: 'metabolites (5% RMS)'.
|
|
58
|
+
|
|
59
|
+
Use these three parameters together to balance sensitivity and
|
|
60
|
+
specificity for your dataset: tune `chrom_fwhm` to match chromatographic
|
|
61
|
+
peak shapes, set `noise` to a conservative background level for your
|
|
62
|
+
instrument, then adjust `chrom_peak_snr` to control how aggressively
|
|
63
|
+
peaks are accepted or rejected.
|
|
64
|
+
|
|
65
|
+
The class also contains many other configuration options (mass tolerances,
|
|
66
|
+
isotope handling, post-processing and reporting flags). See individual
|
|
67
|
+
parameter metadata (`_param_metadata`) for allowed ranges and types.
|
|
20
68
|
"""
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Mass Trace Detection (MTD) Parameters:
|
|
28
|
-
tol_ppm: Mass error tolerance in parts-per-million for mass trace detection.
|
|
29
|
-
noise: Noise threshold intensity to filter out low-intensity signals.
|
|
30
|
-
min_trace_length_multiplier: Multiplier for minimum trace length (multiplied by chrom_fwhm_min).
|
|
31
|
-
trace_termination_outliers: Number of outliers allowed before terminating a trace.
|
|
32
|
-
|
|
33
|
-
Elution Peak Detection (EPD) Parameters:
|
|
34
|
-
chrom_fwhm: Full width at half maximum for chromatographic peak shape.
|
|
35
|
-
chrom_fwhm_min: Minimum FWHM for chromatographic peak detection.
|
|
36
|
-
chrom_peak_snr: Signal-to-noise ratio required for chromatographic peaks.
|
|
37
|
-
masstrace_snr_filtering: Whether to apply SNR filtering to mass traces.
|
|
38
|
-
mz_scoring_13C: Whether to enable scoring of 13C isotopic patterns.
|
|
39
|
-
width_filtering: Width filtering method for mass traces.
|
|
40
|
-
|
|
41
|
-
Feature Finding (FFM) Parameters:
|
|
42
|
-
remove_single_traces: Whether to remove mass traces without satellite isotopic traces.
|
|
43
|
-
report_convex_hulls: Whether to report convex hulls for features.
|
|
44
|
-
report_summed_ints: Whether to report summed intensities.
|
|
45
|
-
report_chromatograms: Whether to report chromatograms.
|
|
46
|
-
|
|
47
|
-
Post-processing Parameters:
|
|
48
|
-
deisotope: Whether to perform deisotoping of detected features.
|
|
49
|
-
deisotope_mz_tol: m/z tolerance for deisotoping.
|
|
50
|
-
deisotope_rt_tol_factor: RT tolerance factor for deisotoping (multiplied by chrom_fwhm_min/4).
|
|
51
|
-
eic_mz_tol: m/z tolerance for EIC extraction.
|
|
52
|
-
eic_rt_tol: RT tolerance for EIC extraction.
|
|
53
|
-
|
|
54
|
-
Available Methods:
|
|
55
|
-
- validate(param_name, value): Validate a single parameter value
|
|
56
|
-
- validate_all(): Validate all parameters at once
|
|
57
|
-
- to_dict(): Convert parameters to dictionary
|
|
58
|
-
- set_from_dict(param_dict, validate=True): Update multiple parameters from dict
|
|
59
|
-
- set(param_name, value, validate=True): Set parameter value with validation
|
|
60
|
-
- get(param_name): Get parameter value
|
|
61
|
-
- get_description(param_name): Get parameter description
|
|
62
|
-
- get_info(param_name): Get full parameter metadata
|
|
63
|
-
- list_parameters(): Get list of all parameter names
|
|
64
|
-
"""
|
|
69
|
+
|
|
70
|
+
# Main params
|
|
71
|
+
noise: float = 200.0
|
|
72
|
+
chrom_fwhm: float = 1.0
|
|
73
|
+
chrom_peak_snr: float = 10.0
|
|
65
74
|
|
|
66
75
|
# Mass Trace Detection parameters
|
|
67
76
|
tol_ppm: float = 30.0
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
77
|
+
reestimate_mt_sd: bool = True
|
|
78
|
+
quant_method: str = "area"
|
|
79
|
+
trace_termination_criterion: str = "outlier"
|
|
80
|
+
trace_termination_outliers: int = 5
|
|
81
|
+
min_sample_rate: float = 0.5
|
|
82
|
+
|
|
83
|
+
min_trace_length: float = 0.5
|
|
84
|
+
min_trace_length_multiplier: float = 0.2
|
|
85
|
+
max_trace_length: float = -1.0
|
|
71
86
|
|
|
72
87
|
# Elution Peak Detection parameters
|
|
73
|
-
|
|
74
|
-
chrom_fwhm_min: float = 0.
|
|
75
|
-
|
|
76
|
-
masstrace_snr_filtering: bool = False
|
|
77
|
-
mz_scoring_13C: bool = False
|
|
88
|
+
enabled: bool = True
|
|
89
|
+
chrom_fwhm_min: float = 0.2
|
|
90
|
+
chrom_fwhm_max: float = 60.0
|
|
78
91
|
width_filtering: str = "fixed"
|
|
92
|
+
masstrace_snr_filtering: bool = False
|
|
79
93
|
|
|
80
94
|
# Feature Finding parameters
|
|
95
|
+
local_rt_range: float = 1.0
|
|
96
|
+
local_mz_range: float = 5.0
|
|
97
|
+
charge_lower_bound: int = 0
|
|
98
|
+
charge_upper_bound: int = 5
|
|
99
|
+
|
|
100
|
+
report_smoothed_intensities: bool = False
|
|
81
101
|
remove_single_traces: bool = False
|
|
82
102
|
report_convex_hulls: bool = True
|
|
83
103
|
report_summed_ints: bool = False
|
|
84
104
|
report_chromatograms: bool = True
|
|
105
|
+
mz_scoring_13C: bool = False
|
|
106
|
+
|
|
107
|
+
threads: int = 1
|
|
108
|
+
no_progress: bool = False
|
|
109
|
+
debug: bool = False
|
|
85
110
|
|
|
86
111
|
# Post-processing parameters
|
|
87
112
|
deisotope: bool = True
|
|
88
113
|
deisotope_mz_tol: float = 0.02
|
|
89
|
-
deisotope_rt_tol_factor: float = 0.
|
|
90
|
-
|
|
91
|
-
eic_rt_tol: float = 10.0
|
|
114
|
+
deisotope_rt_tol_factor: float = 0.5 # Will be multiplied by chrom_fwhm
|
|
115
|
+
isotope_filtering_model: str = "metabolites (5% RMS)"
|
|
92
116
|
|
|
93
|
-
#
|
|
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
|
|
117
|
+
# chrom extraction parameters
|
|
116
118
|
|
|
117
119
|
# Parameter metadata for validation and description
|
|
118
120
|
_param_metadata: dict[str, dict[str, Any]] = field(
|
|
@@ -132,8 +134,8 @@ class find_features_defaults:
|
|
|
132
134
|
"min_trace_length_multiplier": {
|
|
133
135
|
"dtype": float,
|
|
134
136
|
"description": "Multiplier for minimum trace length calculation (multiplied by chrom_fwhm_min)",
|
|
135
|
-
"min_value": 1
|
|
136
|
-
"max_value":
|
|
137
|
+
"min_value": 0.1,
|
|
138
|
+
"max_value": 2.0,
|
|
137
139
|
},
|
|
138
140
|
"trace_termination_outliers": {
|
|
139
141
|
"dtype": int,
|
|
@@ -204,17 +206,11 @@ class find_features_defaults:
|
|
|
204
206
|
"min_value": 0.1,
|
|
205
207
|
"max_value": 2.0,
|
|
206
208
|
},
|
|
207
|
-
"
|
|
208
|
-
"dtype":
|
|
209
|
-
"description": "
|
|
210
|
-
"
|
|
211
|
-
"
|
|
212
|
-
},
|
|
213
|
-
"eic_rt_tol": {
|
|
214
|
-
"dtype": float,
|
|
215
|
-
"description": "RT tolerance for EIC extraction (seconds)",
|
|
216
|
-
"min_value": 1.0,
|
|
217
|
-
"max_value": 60.0,
|
|
209
|
+
"isotope_filtering_model": {
|
|
210
|
+
"dtype": str,
|
|
211
|
+
"description": "Isotope filtering model",
|
|
212
|
+
"default": "metabolites (5% RMS)",
|
|
213
|
+
"allowed_values": ["metabolites (2% RMS)", "metabolites (5% RMS)", "peptides", "none"],
|
|
218
214
|
},
|
|
219
215
|
"threads": {
|
|
220
216
|
"dtype": int,
|
|
@@ -242,13 +238,13 @@ class find_features_defaults:
|
|
|
242
238
|
"min_value": 2,
|
|
243
239
|
"max_value": 100,
|
|
244
240
|
},
|
|
245
|
-
"min_fwhm": {
|
|
241
|
+
""" "min_fwhm": {
|
|
246
242
|
"dtype": float,
|
|
247
243
|
"description": "Minimum full width at half maximum for peaks (seconds)",
|
|
248
244
|
"min_value": 0.1,
|
|
249
245
|
"max_value": 10.0,
|
|
250
|
-
},
|
|
251
|
-
"
|
|
246
|
+
},"""
|
|
247
|
+
"chrom_fwhm_max": {
|
|
252
248
|
"dtype": float,
|
|
253
249
|
"description": "Maximum full width at half maximum for peaks (seconds)",
|
|
254
250
|
"min_value": 1.0,
|
|
@@ -54,6 +54,9 @@ class sample_defaults:
|
|
|
54
54
|
max_points_per_spectrum: int = 50000
|
|
55
55
|
dia_window: float | None = None
|
|
56
56
|
|
|
57
|
+
eic_mz_tol: float = 0.01
|
|
58
|
+
eic_rt_tol: float = 10.0
|
|
59
|
+
|
|
57
60
|
_param_metadata: dict[str, dict[str, Any]] = field(
|
|
58
61
|
default_factory=lambda: {
|
|
59
62
|
"filename": {
|
|
@@ -163,6 +166,18 @@ class sample_defaults:
|
|
|
163
166
|
"default": None,
|
|
164
167
|
"min_value": 0.0,
|
|
165
168
|
},
|
|
169
|
+
"eic_mz_tol": {
|
|
170
|
+
"dtype": float,
|
|
171
|
+
"description": "m/z tolerance for EIC extraction (Da)",
|
|
172
|
+
"min_value": 0.001,
|
|
173
|
+
"max_value": 1.0,
|
|
174
|
+
},
|
|
175
|
+
"eic_rt_tol": {
|
|
176
|
+
"dtype": float,
|
|
177
|
+
"description": "RT tolerance for EIC extraction (seconds)",
|
|
178
|
+
"min_value": 0.2,
|
|
179
|
+
"max_value": 60.0,
|
|
180
|
+
},
|
|
166
181
|
},
|
|
167
182
|
repr=False,
|
|
168
183
|
)
|
masster/sample/h5.py
CHANGED
|
@@ -294,13 +294,13 @@ def _load_sample5(self, filename: str, map: bool = True):
|
|
|
294
294
|
if "metadata" in f:
|
|
295
295
|
metadata_group = f["metadata"]
|
|
296
296
|
self.file_path = decode_metadata_attr(metadata_group.attrs.get("file_path", ""))
|
|
297
|
-
|
|
297
|
+
|
|
298
298
|
# Load file_source if it exists, otherwise set it equal to file_path
|
|
299
299
|
if "file_source" in metadata_group.attrs:
|
|
300
300
|
self.file_source = decode_metadata_attr(metadata_group.attrs.get("file_source", ""))
|
|
301
301
|
else:
|
|
302
302
|
self.file_source = self.file_path
|
|
303
|
-
|
|
303
|
+
|
|
304
304
|
self.file_type = decode_metadata_attr(metadata_group.attrs.get("file_type", ""))
|
|
305
305
|
self.label = decode_metadata_attr(metadata_group.attrs.get("label", ""))
|
|
306
306
|
|