masster 0.3.10__py3-none-any.whl → 0.3.12__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 +16 -6
- masster/sample/defaults/sample_def.py +1 -1
- masster/sample/h5.py +2 -2
- masster/sample/helpers.py +190 -140
- masster/sample/load.py +13 -9
- masster/sample/plot.py +256 -147
- masster/sample/processing.py +18 -12
- masster/sample/sample.py +10 -4
- masster/sample/sample5_schema.json +38 -29
- masster/sample/save.py +16 -13
- masster/sample/sciex.py +187 -176
- masster/study/defaults/align_def.py +231 -13
- 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 +757 -246
- masster/study/helpers_optimized.py +99 -57
- masster/study/load.py +57 -25
- masster/study/plot.py +1244 -129
- masster/study/processing.py +194 -86
- masster/study/save.py +7 -7
- masster/study/study.py +154 -89
- masster/study/study5_schema.json +15 -15
- {masster-0.3.10.dist-info → masster-0.3.12.dist-info}/METADATA +1 -1
- {masster-0.3.10.dist-info → masster-0.3.12.dist-info}/RECORD +33 -31
- {masster-0.3.10.dist-info → masster-0.3.12.dist-info}/WHEEL +0 -0
- {masster-0.3.10.dist-info → masster-0.3.12.dist-info}/entry_points.txt +0 -0
- {masster-0.3.10.dist-info → masster-0.3.12.dist-info}/licenses/LICENSE +0 -0
masster/sample/load.py
CHANGED
|
@@ -85,9 +85,9 @@ def load(
|
|
|
85
85
|
filename = self.file_path
|
|
86
86
|
filename = os.path.abspath(filename)
|
|
87
87
|
if not os.path.exists(filename):
|
|
88
|
-
raise FileNotFoundError(
|
|
88
|
+
raise FileNotFoundError("Filename not valid. Provide a valid file path.")
|
|
89
89
|
self.ondisk = ondisk
|
|
90
|
-
|
|
90
|
+
|
|
91
91
|
# check if file is mzML
|
|
92
92
|
if filename.lower().endswith(".mzml"):
|
|
93
93
|
self._load_mzML(filename)
|
|
@@ -97,7 +97,7 @@ def load(
|
|
|
97
97
|
self._load_raw(filename)
|
|
98
98
|
elif filename.lower().endswith(".sample5"):
|
|
99
99
|
self._load_sample5(filename)
|
|
100
|
-
#elif filename.lower().endswith(".h5"):
|
|
100
|
+
# elif filename.lower().endswith(".h5"):
|
|
101
101
|
# self._load_h5(filename)
|
|
102
102
|
else:
|
|
103
103
|
raise ValueError("File must be .mzML, .wiff, *.raw, or .sample5")
|
|
@@ -137,7 +137,7 @@ def _load_mzML(
|
|
|
137
137
|
# check if filename exists
|
|
138
138
|
if filename is None:
|
|
139
139
|
raise ValueError("Filename must be provided.")
|
|
140
|
-
|
|
140
|
+
|
|
141
141
|
filename = os.path.abspath(filename)
|
|
142
142
|
# check if it exists
|
|
143
143
|
if not os.path.exists(filename):
|
|
@@ -310,7 +310,7 @@ def _load_raw(
|
|
|
310
310
|
- Initiates further analysis by invoking analyze_dda().
|
|
311
311
|
"""
|
|
312
312
|
from alpharaw.thermo import ThermoRawData
|
|
313
|
-
|
|
313
|
+
|
|
314
314
|
if not filename:
|
|
315
315
|
raise ValueError("Filename must be provided.")
|
|
316
316
|
|
|
@@ -318,7 +318,7 @@ def _load_raw(
|
|
|
318
318
|
# check if it exists
|
|
319
319
|
if not os.path.exists(filename):
|
|
320
320
|
raise FileNotFoundError(f"File {filename} not found.")
|
|
321
|
-
|
|
321
|
+
|
|
322
322
|
raw_data = ThermoRawData(centroided=False)
|
|
323
323
|
raw_data.keep_k_peaks_per_spec = self.parameters.max_points_per_spectrum
|
|
324
324
|
# check thatupdat filename ends with .raw
|
|
@@ -470,10 +470,12 @@ def _load_wiff(
|
|
|
470
470
|
try:
|
|
471
471
|
# Use masster's own implementation first
|
|
472
472
|
from masster.sample.sciex import SciexWiffData as MassterSciexWiffData
|
|
473
|
+
|
|
473
474
|
SciexWiffDataClass = MassterSciexWiffData
|
|
474
475
|
except ImportError:
|
|
475
476
|
# Fallback to alpharaw if masster implementation fails
|
|
476
477
|
from alpharaw.sciex import SciexWiffData as AlpharawSciexWiffData
|
|
478
|
+
|
|
477
479
|
SciexWiffDataClass = AlpharawSciexWiffData
|
|
478
480
|
|
|
479
481
|
if not filename:
|
|
@@ -483,7 +485,7 @@ def _load_wiff(
|
|
|
483
485
|
# check if it exists
|
|
484
486
|
if not os.path.exists(filename):
|
|
485
487
|
raise FileNotFoundError(f"File {filename} not found.")
|
|
486
|
-
|
|
488
|
+
|
|
487
489
|
raw_data = SciexWiffDataClass(centroided=False)
|
|
488
490
|
raw_data.keep_k_peaks_per_spec = self.parameters.max_points_per_spectrum
|
|
489
491
|
|
|
@@ -911,7 +913,7 @@ def index_file(self):
|
|
|
911
913
|
oms.MzMLFile().load(self.file_source, omsexp)
|
|
912
914
|
self.file_obj = omsexp
|
|
913
915
|
elif os.path.exists(self.file_source) and self.file_source.lower().endswith(".sample5"):
|
|
914
|
-
# this is an old save, try to see if
|
|
916
|
+
# this is an old save, try to see if
|
|
915
917
|
if os.path.exists(self.file_source.replace(".sample5", ".wiff")):
|
|
916
918
|
self.set_source(self.file_source.replace(".sample5", ".wiff"))
|
|
917
919
|
elif os.path.exists(self.file_source.replace(".sample5", ".raw")):
|
|
@@ -919,7 +921,9 @@ def index_file(self):
|
|
|
919
921
|
elif os.path.exists(self.file_source.replace(".sample5", ".mzml")):
|
|
920
922
|
self.set_source(self.file_source.replace(".sample5", ".mzml"))
|
|
921
923
|
else:
|
|
922
|
-
raise FileNotFoundError(
|
|
924
|
+
raise FileNotFoundError(
|
|
925
|
+
f"File {self.file_source} not found. Did the path change? Consider running source()."
|
|
926
|
+
)
|
|
923
927
|
self.index_file()
|
|
924
928
|
else:
|
|
925
929
|
raise FileNotFoundError(f"File {self.file_source} not found. Did the path change? Consider running source().")
|