masster 0.4.17__tar.gz → 0.4.19__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.
- {masster-0.4.17 → masster-0.4.19}/PKG-INFO +1 -1
- {masster-0.4.17 → masster-0.4.19}/pyproject.toml +1 -1
- {masster-0.4.17 → masster-0.4.19}/src/masster/_version.py +1 -1
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/defaults/merge_def.py +53 -11
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/merge.py +628 -75
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/processing.py +0 -1
- {masster-0.4.17 → masster-0.4.19}/uv.lock +1 -1
- {masster-0.4.17 → masster-0.4.19}/.github/workflows/publish.yml +0 -0
- {masster-0.4.17 → masster-0.4.19}/.github/workflows/security.yml +0 -0
- {masster-0.4.17 → masster-0.4.19}/.github/workflows/test.yml +0 -0
- {masster-0.4.17 → masster-0.4.19}/.gitignore +0 -0
- {masster-0.4.17 → masster-0.4.19}/.pre-commit-config.yaml +0 -0
- {masster-0.4.17 → masster-0.4.19}/LICENSE +0 -0
- {masster-0.4.17 → masster-0.4.19}/Makefile +0 -0
- {masster-0.4.17 → masster-0.4.19}/README.md +0 -0
- {masster-0.4.17 → masster-0.4.19}/TESTING.md +0 -0
- {masster-0.4.17 → masster-0.4.19}/demo/example_batch_process.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/demo/example_sample_process.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/__init__.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/chromatogram.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/data/dda/20250530_VH_IQX_KW_RP_HSST3_100mm_12min_pos_v4_DDA_OT_C-MiLUT_QC_dil2_01_20250602151849.sample5 +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/data/dda/20250530_VH_IQX_KW_RP_HSST3_100mm_12min_pos_v4_DDA_OT_C-MiLUT_QC_dil3_01_20250602150634.sample5 +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/data/dda/20250530_VH_IQX_KW_RP_HSST3_100mm_12min_pos_v4_MS1_C-MiLUT_C008_v6_r38_01.sample5 +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/data/dda/20250530_VH_IQX_KW_RP_HSST3_100mm_12min_pos_v4_MS1_C-MiLUT_C008_v7_r37_01.sample5 +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/data/dda/20250530_VH_IQX_KW_RP_HSST3_100mm_12min_pos_v4_MS1_C-MiLUT_C017_v5_r99_01.sample5 +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/data/libs/ccm.csv +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/data/libs/urine.csv +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/data/wiff/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.timeseries.data +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/data/wiff/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.wiff +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/data/wiff/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.wiff.scan +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/data/wiff/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.wiff2 +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/lib/__init__.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/lib/lib.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/logger.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/__init__.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/adducts.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/defaults/__init__.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/defaults/find_adducts_def.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/defaults/find_features_def.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/defaults/find_ms2_def.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/defaults/get_spectrum_def.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/defaults/sample_def.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/h5.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/helpers.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/lib.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/load.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/parameters.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/plot.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/processing.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/quant.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/sample.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/sample5_schema.json +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/save.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/sample/sciex.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/spectrum.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/__init__.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/defaults/__init__.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/defaults/align_def.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/defaults/export_def.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/defaults/fill_chrom_def.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/defaults/fill_def.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/defaults/find_consensus_def.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/defaults/find_ms2_def.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/defaults/identify_def.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/defaults/integrate_chrom_def.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/defaults/integrate_def.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/defaults/study_def.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/export.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/h5.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/helpers.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/id.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/load.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/parameters.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/plot.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/save.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/study.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/study/study5_schema.json +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/wizard/README.md +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/wizard/__init__.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/wizard/example.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/wizard/test_structure.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/wizard/test_wizard.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/wizard/wizard.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/src/masster/wizard.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/tests/conftest.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/tests/test_chromatogram.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/tests/test_defaults.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/tests/test_imports.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/tests/test_integration.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/tests/test_logger.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/tests/test_parameters.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/tests/test_sample.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/tests/test_spectrum.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/tests/test_study.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/tests/test_version.py +0 -0
- {masster-0.4.17 → masster-0.4.19}/tox.ini +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Parameter class for Study merge method."""
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass, field
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import Any, Optional
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
@dataclass
|
|
@@ -25,25 +25,28 @@ class merge_defaults:
|
|
|
25
25
|
link_ms2 (bool): Whether to link MS2 spectra to consensus features. Default is True.
|
|
26
26
|
"""
|
|
27
27
|
|
|
28
|
-
method: str = "
|
|
29
|
-
min_samples: int =
|
|
28
|
+
method: str = "qt"
|
|
29
|
+
min_samples: int = 2
|
|
30
30
|
rt_tol: float = 5.0
|
|
31
31
|
mz_tol: float = 0.01
|
|
32
|
-
chunk_size: int =
|
|
32
|
+
chunk_size: int = 500
|
|
33
33
|
nr_partitions: int = 1000
|
|
34
|
-
min_rel_cc_size: float = 0.
|
|
34
|
+
min_rel_cc_size: float = 0.1
|
|
35
35
|
max_pairwise_log_fc: float = -1.0
|
|
36
36
|
max_nr_conflicts: int = 0
|
|
37
37
|
link_ms2: bool = True
|
|
38
38
|
|
|
39
|
+
# Parallel processing parameters
|
|
40
|
+
threads: Optional[int] = None
|
|
41
|
+
|
|
39
42
|
# KD-Strict specific parameters
|
|
40
43
|
optimize_rt_tol: bool = False
|
|
41
|
-
rt_tol_range: tuple = (0.
|
|
42
|
-
rt_tol_steps: int =
|
|
43
|
-
secondary_merge_rt_tol: float = 0
|
|
44
|
+
rt_tol_range: tuple = (0.5, 4.0)
|
|
45
|
+
rt_tol_steps: int = 7
|
|
46
|
+
secondary_merge_rt_tol: float = 1.0
|
|
44
47
|
secondary_merge_mz_tol: float = 0.005
|
|
45
48
|
min_sample_overlap: float = 0.8
|
|
46
|
-
max_rt_spread: float =
|
|
49
|
+
max_rt_spread: float = 2.0 # Will default to 2x rt_tol
|
|
47
50
|
min_coherence: float = 0.0
|
|
48
51
|
|
|
49
52
|
_param_metadata: dict[str, dict[str, Any]] = field(
|
|
@@ -53,7 +56,8 @@ class merge_defaults:
|
|
|
53
56
|
"description": "Merge method (algorithm) to use",
|
|
54
57
|
"default": "quality",
|
|
55
58
|
"allowed_values": ["sensitivity", "qt", "nowarp", "chunked", "quality",
|
|
56
|
-
"kd", "kd-nowarp", "kd_nowarp", "kd-strict", "kd_strict"
|
|
59
|
+
"kd", "kd-nowarp", "kd_nowarp", "kd-strict", "kd_strict",
|
|
60
|
+
"kd_chunked", "kd-chunked", "qt_chunked", "qt-chunked"],
|
|
57
61
|
},
|
|
58
62
|
"min_samples": {
|
|
59
63
|
"dtype": int,
|
|
@@ -114,6 +118,14 @@ class merge_defaults:
|
|
|
114
118
|
"description": "Whether to link MS2 spectra to consensus features",
|
|
115
119
|
"default": True,
|
|
116
120
|
},
|
|
121
|
+
# Parallel processing parameters
|
|
122
|
+
"threads": {
|
|
123
|
+
"dtype": [int, type(None)],
|
|
124
|
+
"description": "Number of parallel threads/processes for chunked methods (None=original sequential)",
|
|
125
|
+
"default": None,
|
|
126
|
+
"min_value": 1,
|
|
127
|
+
"max_value": 32,
|
|
128
|
+
},
|
|
117
129
|
# KD-Strict specific parameters
|
|
118
130
|
"optimize_rt_tol": {
|
|
119
131
|
"dtype": bool,
|
|
@@ -216,7 +228,37 @@ class merge_defaults:
|
|
|
216
228
|
metadata = self._param_metadata[param_name]
|
|
217
229
|
expected_dtype = metadata["dtype"]
|
|
218
230
|
|
|
219
|
-
#
|
|
231
|
+
# Handle Optional types (list of types including None)
|
|
232
|
+
if isinstance(expected_dtype, list):
|
|
233
|
+
# Check if value matches any of the allowed types
|
|
234
|
+
valid_type = False
|
|
235
|
+
for dtype in expected_dtype:
|
|
236
|
+
if dtype is type(None) and value is None:
|
|
237
|
+
return True # None is explicitly allowed
|
|
238
|
+
elif dtype is int and isinstance(value, int):
|
|
239
|
+
valid_type = True
|
|
240
|
+
break
|
|
241
|
+
elif dtype is float and isinstance(value, (int, float)):
|
|
242
|
+
valid_type = True
|
|
243
|
+
break
|
|
244
|
+
elif dtype is bool and isinstance(value, bool):
|
|
245
|
+
valid_type = True
|
|
246
|
+
break
|
|
247
|
+
elif dtype is str and isinstance(value, str):
|
|
248
|
+
valid_type = True
|
|
249
|
+
break
|
|
250
|
+
|
|
251
|
+
if not valid_type:
|
|
252
|
+
return False
|
|
253
|
+
|
|
254
|
+
# For None values, skip further validation
|
|
255
|
+
if value is None:
|
|
256
|
+
return True
|
|
257
|
+
|
|
258
|
+
# Use the first non-None type for range validation
|
|
259
|
+
expected_dtype = next((dt for dt in expected_dtype if dt is not type(None)), expected_dtype[0])
|
|
260
|
+
|
|
261
|
+
# Type checking for non-Optional types
|
|
220
262
|
if expected_dtype is int:
|
|
221
263
|
if not isinstance(value, int):
|
|
222
264
|
try:
|