masster 0.3.13__py3-none-any.whl → 0.3.14__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/_version.py +1 -1
- masster/study/helpers.py +492 -2
- masster/study/load.py +7 -5
- masster/study/plot.py +261 -96
- masster/study/processing.py +9 -0
- masster/study/study.py +8 -25
- {masster-0.3.13.dist-info → masster-0.3.14.dist-info}/METADATA +2 -1
- {masster-0.3.13.dist-info → masster-0.3.14.dist-info}/RECORD +11 -15
- masster/data/examples/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.featureXML +0 -199787
- masster/data/examples/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.sample5 +0 -0
- masster/docs/SCX_API_Documentation.md +0 -0
- masster/docs/SCX_DLL_Analysis.md +0 -0
- {masster-0.3.13.dist-info → masster-0.3.14.dist-info}/WHEEL +0 -0
- {masster-0.3.13.dist-info → masster-0.3.14.dist-info}/entry_points.txt +0 -0
- {masster-0.3.13.dist-info → masster-0.3.14.dist-info}/licenses/LICENSE +0 -0
masster/study/processing.py
CHANGED
|
@@ -683,6 +683,15 @@ def merge(self, **kwargs):
|
|
|
683
683
|
min_samples = 1
|
|
684
684
|
if min_samples < 1:
|
|
685
685
|
min_samples = int(min_samples * len(self.samples_df))
|
|
686
|
+
|
|
687
|
+
# Validate that min_samples doesn't exceed the number of samples
|
|
688
|
+
if min_samples > len(self.samples_df):
|
|
689
|
+
self.logger.warning(
|
|
690
|
+
f"min_samples ({min_samples}) exceeds the number of samples ({len(self.samples_df)}). "
|
|
691
|
+
f"Setting min_samples to {len(self.samples_df)}."
|
|
692
|
+
)
|
|
693
|
+
min_samples = len(self.samples_df)
|
|
694
|
+
|
|
686
695
|
# filter out consensus features with less than min_samples features
|
|
687
696
|
l1 = len(self.consensus_df)
|
|
688
697
|
self.consensus_df = self.consensus_df.filter(
|
masster/study/study.py
CHANGED
|
@@ -59,6 +59,7 @@ from masster.study.h5 import _save_study5_compressed
|
|
|
59
59
|
from masster.study.helpers import _get_consensus_uids
|
|
60
60
|
from masster.study.helpers import _get_feature_uids
|
|
61
61
|
from masster.study.helpers import _get_sample_uids
|
|
62
|
+
from masster.study.helpers import _ensure_features_df_schema_order
|
|
62
63
|
from masster.study.helpers import compress
|
|
63
64
|
from masster.study.helpers import compress_features
|
|
64
65
|
from masster.study.helpers import compress_ms2
|
|
@@ -77,6 +78,8 @@ from masster.study.helpers import get_gaps_stats
|
|
|
77
78
|
from masster.study.helpers import align_reset
|
|
78
79
|
from masster.study.helpers import set_folder
|
|
79
80
|
from masster.study.helpers import set_source
|
|
81
|
+
from masster.study.helpers import sample_color
|
|
82
|
+
from masster.study.helpers import sample_color_reset
|
|
80
83
|
from masster.study.helpers import name_replace
|
|
81
84
|
from masster.study.helpers import name_reset
|
|
82
85
|
from masster.study.helpers import features_select
|
|
@@ -281,6 +284,7 @@ class Study:
|
|
|
281
284
|
"file_source": [],
|
|
282
285
|
"ms1": [],
|
|
283
286
|
"ms2": [],
|
|
287
|
+
"sample_color": [],
|
|
284
288
|
},
|
|
285
289
|
schema={
|
|
286
290
|
"sample_uid": pl.Int64,
|
|
@@ -292,6 +296,7 @@ class Study:
|
|
|
292
296
|
"file_source": pl.Utf8,
|
|
293
297
|
"ms1": pl.Int64,
|
|
294
298
|
"ms2": pl.Int64,
|
|
299
|
+
"sample_color": pl.Utf8,
|
|
295
300
|
},
|
|
296
301
|
)
|
|
297
302
|
self.features_maps = []
|
|
@@ -362,6 +367,8 @@ class Study:
|
|
|
362
367
|
fill_reset = fill_reset
|
|
363
368
|
align_reset = align_reset
|
|
364
369
|
set_source = set_source
|
|
370
|
+
sample_color = sample_color
|
|
371
|
+
sample_color_reset = sample_color_reset
|
|
365
372
|
name_replace = name_replace
|
|
366
373
|
name_reset = name_reset
|
|
367
374
|
features_select = features_select
|
|
@@ -387,6 +394,7 @@ class Study:
|
|
|
387
394
|
_get_consensus_uids = _get_consensus_uids
|
|
388
395
|
_get_feature_uids = _get_feature_uids
|
|
389
396
|
_get_sample_uids = _get_sample_uids
|
|
397
|
+
_ensure_features_df_schema_order = _ensure_features_df_schema_order
|
|
390
398
|
get_consensus_matrix = get_consensus_matrix
|
|
391
399
|
get_gaps_matrix = get_gaps_matrix
|
|
392
400
|
get_gaps_stats = get_gaps_stats
|
|
@@ -685,31 +693,6 @@ class Study:
|
|
|
685
693
|
|
|
686
694
|
print(summary)
|
|
687
695
|
|
|
688
|
-
def _ensure_features_df_schema_order(self):
|
|
689
|
-
"""
|
|
690
|
-
Ensure features_df columns are ordered according to study5_schema.json.
|
|
691
|
-
|
|
692
|
-
This method should be called after operations that might scramble the column order.
|
|
693
|
-
"""
|
|
694
|
-
if self.features_df is None or self.features_df.is_empty():
|
|
695
|
-
return
|
|
696
|
-
|
|
697
|
-
try:
|
|
698
|
-
import os
|
|
699
|
-
import json
|
|
700
|
-
from masster.study.h5 import _reorder_columns_by_schema
|
|
701
|
-
|
|
702
|
-
# Load schema
|
|
703
|
-
schema_path = os.path.join(os.path.dirname(__file__), "study5_schema.json")
|
|
704
|
-
with open(schema_path, 'r') as f:
|
|
705
|
-
schema = json.load(f)
|
|
706
|
-
|
|
707
|
-
# Reorder columns to match schema
|
|
708
|
-
self.features_df = _reorder_columns_by_schema(self.features_df, schema, 'features_df')
|
|
709
|
-
|
|
710
|
-
except Exception as e:
|
|
711
|
-
self.logger.warning(f"Failed to reorder features_df columns: {e}")
|
|
712
|
-
|
|
713
696
|
|
|
714
697
|
if __name__ == "__main__":
|
|
715
698
|
# This block is executed when the script is run directly
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: masster
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.14
|
|
4
4
|
Summary: Mass spectrometry data analysis package
|
|
5
5
|
Project-URL: homepage, https://github.com/zamboni-lab/masster
|
|
6
6
|
Project-URL: repository, https://github.com/zamboni-lab/masster
|
|
@@ -684,6 +684,7 @@ Requires-Dist: alphabase>=1.0.0
|
|
|
684
684
|
Requires-Dist: alpharaw>=0.4.8
|
|
685
685
|
Requires-Dist: altair>=5.5.0
|
|
686
686
|
Requires-Dist: bokeh>=3.7.3
|
|
687
|
+
Requires-Dist: cmap>=0.6.2
|
|
687
688
|
Requires-Dist: datashader>=0.18.1
|
|
688
689
|
Requires-Dist: h5py>=3.14.0
|
|
689
690
|
Requires-Dist: holoviews>=1.21.0
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
masster/__init__.py,sha256=G7hbKO8F_o1wFwQlvO25M8JYGka_YSAVU2_O__2rjlI,697
|
|
2
|
-
masster/_version.py,sha256=
|
|
2
|
+
masster/_version.py,sha256=ginlJdJgdMh1rp81NNhKs0fwmLr17IZA4S9-6W_glZw,257
|
|
3
3
|
masster/chromatogram.py,sha256=NgPr1uLGJHjRu6PWZZGOrS3pCl7sye1yQCJjlRi9ZSY,19305
|
|
4
4
|
masster/logger.py,sha256=W50V_uh8RSYwGxDrDFhOuj5jpu2tKJyt_16lMw9kQwA,14755
|
|
5
5
|
masster/spectrum.py,sha256=LuDa7qP_JInctzkmxC9c5468opHOholy321KpUgyW2U,47550
|
|
6
|
-
masster/data/examples/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.featureXML,sha256=033IjCWBaYVymnPhVHneytilC-XIa6T-6wkeBB0BXvc,10980374
|
|
7
6
|
masster/data/examples/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.mzML,sha256=3RS_crLN-aoPSacMYaQ45sxszmp_EcQElrg8tiuAQyA,39741920
|
|
8
|
-
masster/data/examples/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.sample5,sha256=T3LxClfe3Uaqx4Rb7lY57e2uWpuJHzPy-VEl3cy4b7k,11109448
|
|
9
7
|
masster/data/examples/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.timeseries.data,sha256=01vC6m__Qqm2rLvlTMZoeKIKowFvovBTUnrNl8Uav3E,24576
|
|
10
8
|
masster/data/examples/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.wiff,sha256=go5N9gAM1rn4PZAVaoCmdteY9f7YGEM9gyPdSmkQ8PE,1447936
|
|
11
9
|
masster/data/examples/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.wiff.scan,sha256=ahi1Y3UhAj9Bj4Q2MlbgPekNdkJvMOoMXVOoR6CeIxc,13881220
|
|
12
10
|
masster/data/examples/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.wiff2,sha256=TFB0HW4Agkig6yht7FtgjUdbXax8jjKaHpSZSvuU5vs,3252224
|
|
13
|
-
masster/docs/SCX_API_Documentation.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
-
masster/docs/SCX_DLL_Analysis.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
11
|
masster/sample/__init__.py,sha256=HL0m1ept0PMAYUCQtDDnkdOS12IFl6oLAq4TZQz83uY,170
|
|
16
12
|
masster/sample/h5.py,sha256=IdfbdkDgKcij-jMQTxnjW-gsBhb6vwi8w1XXL795yEs,63793
|
|
17
13
|
masster/sample/helpers.py,sha256=U2VyboRdTsQbOefCy7VXh6PlSQtEsR6BK5QF2jGUd94,36208
|
|
@@ -34,14 +30,14 @@ masster/sample/defaults/sample_def.py,sha256=keoXyMyrm_iLgbYqfIbqCpJ3XHBVlNwCNmb
|
|
|
34
30
|
masster/study/__init__.py,sha256=Zspv6U8jFqjkHGYdNdDy1rfUnCSolCzUdgSSg98PRgE,166
|
|
35
31
|
masster/study/export.py,sha256=9Bhz8wpO3ZHdwV0iWSX0E38GS3UfqfAFlW9VN8ht2-Y,28845
|
|
36
32
|
masster/study/h5.py,sha256=UOc4tbeWr8Xa_5Aescz7rMMnkzpu8PSTsOAnTfPv0-E,67109
|
|
37
|
-
masster/study/helpers.py,sha256=
|
|
33
|
+
masster/study/helpers.py,sha256=O5aTbbELc_zCOPHg0YO4PXrVjWE_gKQuDxjdVfaDKwU,112710
|
|
38
34
|
masster/study/helpers_optimized.py,sha256=sd87kNPIEPdMijekXzZWSyeZzJ_DTAW8HQjAry-jVyY,13922
|
|
39
|
-
masster/study/load.py,sha256=
|
|
35
|
+
masster/study/load.py,sha256=1wRIIB-n8H1d9vUtb7GTaJLIS4AHrujAafGs4tvJrcs,49647
|
|
40
36
|
masster/study/parameters.py,sha256=0elaF7YspTsB7qyajWAbRNL2VfKlGz5GJLifmO8IGkk,3276
|
|
41
|
-
masster/study/plot.py,sha256
|
|
42
|
-
masster/study/processing.py,sha256=
|
|
37
|
+
masster/study/plot.py,sha256=-WYiR-tmXP9x2YKn6fxy6UyJnAxptuvPw9g-13zo6WY,75899
|
|
38
|
+
masster/study/processing.py,sha256=ijLaVKZlPJQpcQh_u-Cj6acrSEOaB3vKMNzS9alXdzg,52661
|
|
43
39
|
masster/study/save.py,sha256=YjFEiuiB4OFLVvW_AX4-kgnsbjCWrYZeqF85VNEtbdw,6560
|
|
44
|
-
masster/study/study.py,sha256=
|
|
40
|
+
masster/study/study.py,sha256=2ReH0w6-oIAypQZVxSe3IKFAbHPIJSC9JyuDRhaOSOc,30749
|
|
45
41
|
masster/study/study5_schema.json,sha256=Grm2vfi2NnfNfcqKndz3IX9JNyhgwh92T8x-IofLay4,5103
|
|
46
42
|
masster/study/defaults/__init__.py,sha256=m3Z5KXGqsTdh7GjYzZoENERt39yRg0ceVRV1DeCt1P0,610
|
|
47
43
|
masster/study/defaults/align_def.py,sha256=QSJXfe5kAtYp_IN8LUuXjq61IkxT74ml84k5kmmRjqM,19846
|
|
@@ -54,8 +50,8 @@ masster/study/defaults/integrate_chrom_def.py,sha256=0MNIWGTjty-Zu-NTQsIweuj3UVq
|
|
|
54
50
|
masster/study/defaults/integrate_def.py,sha256=Vf4SAzdBfnsSZ3IRaF0qZvWu3gMDPHdgPfMYoPKeWv8,7246
|
|
55
51
|
masster/study/defaults/merge_def.py,sha256=EBsKE3hsAkTEzN9dpdRD5W3_suTKy_WZ_96rwS0uBuE,8572
|
|
56
52
|
masster/study/defaults/study_def.py,sha256=d8mQWIpvWEWI8grPTAcQa4jKTG7QrM98RRgHZVoh134,9519
|
|
57
|
-
masster-0.3.
|
|
58
|
-
masster-0.3.
|
|
59
|
-
masster-0.3.
|
|
60
|
-
masster-0.3.
|
|
61
|
-
masster-0.3.
|
|
53
|
+
masster-0.3.14.dist-info/METADATA,sha256=ekvyajONIIV7y6Ma8rFE6U0EnPgq07XpXB8ox1e-Ld4,44320
|
|
54
|
+
masster-0.3.14.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
55
|
+
masster-0.3.14.dist-info/entry_points.txt,sha256=ZHguQ_vPmdbpqq2uGtmEOLJfgP-DQ1T0c07Lxh30wc8,58
|
|
56
|
+
masster-0.3.14.dist-info/licenses/LICENSE,sha256=bx5iLIKjgAdYQ7sISn7DsfHRKkoCUm1154sJJKhgqnU,35184
|
|
57
|
+
masster-0.3.14.dist-info/RECORD,,
|