masster 0.4.0__py3-none-any.whl → 0.4.1__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.
- masster/__init__.py +8 -8
- masster/_version.py +1 -1
- masster/chromatogram.py +3 -9
- masster/data/libs/README.md +1 -1
- masster/data/libs/ccm.csv +120 -120
- masster/data/libs/ccm.py +116 -62
- masster/data/libs/central_carbon_README.md +1 -1
- masster/data/libs/urine.py +161 -65
- masster/data/libs/urine_metabolites.csv +4693 -4693
- masster/data/wiff/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.mzML +2 -2
- masster/logger.py +43 -78
- masster/sample/__init__.py +1 -1
- masster/sample/adducts.py +264 -338
- masster/sample/defaults/find_adducts_def.py +8 -21
- masster/sample/defaults/find_features_def.py +1 -6
- masster/sample/defaults/get_spectrum_def.py +1 -5
- masster/sample/defaults/sample_def.py +1 -5
- masster/sample/h5.py +282 -561
- masster/sample/helpers.py +75 -131
- masster/sample/lib.py +17 -42
- masster/sample/load.py +17 -31
- masster/sample/parameters.py +2 -6
- masster/sample/plot.py +27 -88
- masster/sample/processing.py +87 -117
- masster/sample/quant.py +51 -57
- masster/sample/sample.py +90 -103
- masster/sample/sample5_schema.json +44 -44
- masster/sample/save.py +12 -35
- masster/sample/sciex.py +19 -66
- masster/spectrum.py +20 -58
- masster/study/__init__.py +1 -1
- masster/study/defaults/align_def.py +1 -5
- masster/study/defaults/fill_chrom_def.py +1 -5
- masster/study/defaults/fill_def.py +1 -5
- masster/study/defaults/integrate_chrom_def.py +1 -5
- masster/study/defaults/integrate_def.py +1 -5
- masster/study/defaults/study_def.py +25 -58
- masster/study/export.py +207 -233
- masster/study/h5.py +136 -470
- masster/study/helpers.py +202 -495
- masster/study/helpers_optimized.py +13 -40
- masster/study/id.py +110 -213
- masster/study/load.py +143 -230
- masster/study/plot.py +257 -518
- masster/study/processing.py +257 -469
- masster/study/save.py +5 -15
- masster/study/study.py +276 -379
- masster/study/study5_schema.json +96 -96
- {masster-0.4.0.dist-info → masster-0.4.1.dist-info}/METADATA +1 -1
- masster-0.4.1.dist-info/RECORD +67 -0
- masster-0.4.0.dist-info/RECORD +0 -67
- {masster-0.4.0.dist-info → masster-0.4.1.dist-info}/WHEEL +0 -0
- {masster-0.4.0.dist-info → masster-0.4.1.dist-info}/entry_points.txt +0 -0
- {masster-0.4.0.dist-info → masster-0.4.1.dist-info}/licenses/LICENSE +0 -0
masster/study/save.py
CHANGED
|
@@ -9,7 +9,7 @@ import pyopenms as oms
|
|
|
9
9
|
|
|
10
10
|
from tqdm import tqdm
|
|
11
11
|
|
|
12
|
-
from
|
|
12
|
+
from masster.sample.sample import Sample
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
def save(self, filename=None, add_timestamp=True, compress=False):
|
|
@@ -48,14 +48,8 @@ def save(self, filename=None, add_timestamp=True, compress=False):
|
|
|
48
48
|
# Log file size information for performance monitoring
|
|
49
49
|
if hasattr(self, "features_df") and not self.features_df.is_empty():
|
|
50
50
|
feature_count = len(self.features_df)
|
|
51
|
-
sample_count = (
|
|
52
|
-
|
|
53
|
-
if hasattr(self, "samples_df") and not self.samples_df.is_empty()
|
|
54
|
-
else 0
|
|
55
|
-
)
|
|
56
|
-
self.logger.info(
|
|
57
|
-
f"Saving study with {sample_count} samples and {feature_count} features to {filename}",
|
|
58
|
-
)
|
|
51
|
+
sample_count = len(self.samples_df) if hasattr(self, "samples_df") and not self.samples_df.is_empty() else 0
|
|
52
|
+
self.logger.info(f"Saving study with {sample_count} samples and {feature_count} features to {filename}")
|
|
59
53
|
|
|
60
54
|
# Use compressed mode for large datasets
|
|
61
55
|
if compress:
|
|
@@ -127,9 +121,7 @@ def save_samples(self, samples=None):
|
|
|
127
121
|
if sample_path.endswith(".sample5"):
|
|
128
122
|
# If sample_path is a .sample5 file, save featureXML in the same directory
|
|
129
123
|
featurexml_filename = sample_path.replace(".sample5", ".featureXML")
|
|
130
|
-
self.logger.debug(
|
|
131
|
-
f"Saving featureXML alongside .sample5 file: {featurexml_filename}",
|
|
132
|
-
)
|
|
124
|
+
self.logger.debug(f"Saving featureXML alongside .sample5 file: {featurexml_filename}")
|
|
133
125
|
else:
|
|
134
126
|
# Fallback to study folder or current directory (original behavior)
|
|
135
127
|
if self.folder is not None:
|
|
@@ -142,9 +134,7 @@ def save_samples(self, samples=None):
|
|
|
142
134
|
os.getcwd(),
|
|
143
135
|
sample_name + ".featureXML",
|
|
144
136
|
)
|
|
145
|
-
self.logger.debug(
|
|
146
|
-
f"Saving featureXML to default location: {featurexml_filename}",
|
|
147
|
-
)
|
|
137
|
+
self.logger.debug(f"Saving featureXML to default location: {featurexml_filename}")
|
|
148
138
|
|
|
149
139
|
fh = oms.FeatureXMLFile()
|
|
150
140
|
if sample_index is not None and sample_index < len(self.features_maps):
|