masster 0.4.11__py3-none-any.whl → 0.4.13__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/lib/lib.py +45 -3
- masster/study/helpers.py +262 -310
- masster/study/id.py +564 -324
- masster/study/plot.py +38 -23
- masster/study/processing.py +268 -178
- masster/study/study.py +95 -60
- masster/study/study5_schema.json +12 -0
- {masster-0.4.11.dist-info → masster-0.4.13.dist-info}/METADATA +1 -1
- {masster-0.4.11.dist-info → masster-0.4.13.dist-info}/RECORD +13 -13
- {masster-0.4.11.dist-info → masster-0.4.13.dist-info}/WHEEL +0 -0
- {masster-0.4.11.dist-info → masster-0.4.13.dist-info}/entry_points.txt +0 -0
- {masster-0.4.11.dist-info → masster-0.4.13.dist-info}/licenses/LICENSE +0 -0
masster/study/study.py
CHANGED
|
@@ -338,6 +338,7 @@ class Study:
|
|
|
338
338
|
|
|
339
339
|
# Library DataFrame (populated by lib_load)
|
|
340
340
|
self.lib_df = pl.DataFrame()
|
|
341
|
+
|
|
341
342
|
# Identification results DataFrame (populated by identify)
|
|
342
343
|
self.id_df = pl.DataFrame()
|
|
343
344
|
|
|
@@ -358,53 +359,44 @@ class Study:
|
|
|
358
359
|
# cache for Sample instances created/loaded by this Study
|
|
359
360
|
self._samples_cache = {}
|
|
360
361
|
|
|
361
|
-
#
|
|
362
|
+
# ===== ATTACH MODULE FUNCTIONS AS CLASS METHODS =====
|
|
363
|
+
|
|
364
|
+
# === File I/O Operations ===
|
|
362
365
|
load = load
|
|
363
366
|
save = save
|
|
364
367
|
save_consensus = save_consensus
|
|
365
368
|
save_samples = save_samples
|
|
369
|
+
sanitize = sanitize
|
|
370
|
+
set_folder = set_folder
|
|
371
|
+
|
|
372
|
+
# === Sample Management ===
|
|
373
|
+
add = add
|
|
374
|
+
add_folder = add # backward compatibility alias
|
|
375
|
+
add_sample = add_sample
|
|
376
|
+
|
|
377
|
+
# === Core Processing Operations ===
|
|
366
378
|
align = align
|
|
367
|
-
fill_single = fill_single
|
|
368
|
-
fill_chrom_single = fill_single # Backward compatibility alias
|
|
369
379
|
merge = merge
|
|
370
380
|
find_consensus = merge # Backward compatibility alias
|
|
371
381
|
find_ms2 = find_ms2
|
|
372
382
|
integrate = integrate
|
|
373
383
|
integrate_chrom = integrate # Backward compatibility alias
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
plot_chrom = plot_chrom
|
|
381
|
-
plot_consensus_2d = plot_consensus_2d
|
|
382
|
-
plot_consensus_stats = plot_consensus_stats
|
|
383
|
-
plot_pca = plot_pca
|
|
384
|
-
plot_samples_2d = plot_samples_2d
|
|
385
|
-
plot_bpc = plot_bpc
|
|
386
|
-
plot_rt_correction = plot_rt_correction
|
|
387
|
-
plot_tic = plot_tic
|
|
388
|
-
plot_eic = plot_eic
|
|
384
|
+
fill = fill
|
|
385
|
+
fill_chrom = fill # Backward compatibility alias
|
|
386
|
+
fill_single = fill_single
|
|
387
|
+
fill_chrom_single = fill_single # Backward compatibility alias
|
|
388
|
+
|
|
389
|
+
# === Data Retrieval and Access ===
|
|
389
390
|
get_consensus = get_consensus
|
|
390
391
|
get_chrom = get_chrom
|
|
391
392
|
get_sample = get_sample
|
|
392
393
|
get_consensus_matches = get_consensus_matches
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
restore_ms2 = restore_ms2
|
|
400
|
-
decompress = decompress
|
|
401
|
-
fill_reset = fill_reset
|
|
402
|
-
align_reset = align_reset
|
|
403
|
-
set_source = set_source
|
|
404
|
-
sample_color = sample_color
|
|
405
|
-
sample_color_reset = sample_color_reset
|
|
406
|
-
name_replace = sample_name_replace
|
|
407
|
-
name_reset = sample_name_reset
|
|
394
|
+
get_consensus_matrix = get_consensus_matrix
|
|
395
|
+
get_gaps_matrix = get_gaps_matrix
|
|
396
|
+
get_gaps_stats = get_gaps_stats
|
|
397
|
+
get_orphans = get_orphans
|
|
398
|
+
|
|
399
|
+
# === Data Selection and Filtering ===
|
|
408
400
|
samples_select = samples_select
|
|
409
401
|
samples_delete = samples_delete
|
|
410
402
|
features_select = features_select
|
|
@@ -413,16 +405,67 @@ class Study:
|
|
|
413
405
|
consensus_select = consensus_select
|
|
414
406
|
consensus_filter = consensus_filter
|
|
415
407
|
consensus_delete = consensus_delete
|
|
408
|
+
# Backward compatibility aliases
|
|
416
409
|
filter_consensus = consensus_filter
|
|
417
410
|
select_consensus = consensus_select
|
|
418
411
|
filter_features = features_filter
|
|
419
412
|
select_features = features_select
|
|
420
413
|
consensus_find = merge
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
414
|
+
|
|
415
|
+
# === Sample Metadata and Styling ===
|
|
416
|
+
set_source = set_source
|
|
417
|
+
sample_color = sample_color
|
|
418
|
+
sample_color_reset = sample_color_reset
|
|
419
|
+
name_replace = sample_name_replace
|
|
420
|
+
name_reset = sample_name_reset
|
|
421
|
+
|
|
422
|
+
# === Data Compression and Storage ===
|
|
423
|
+
compress = compress
|
|
424
|
+
compress_features = compress_features
|
|
425
|
+
compress_ms2 = compress_ms2
|
|
426
|
+
compress_chrom = compress_chrom
|
|
427
|
+
restore_features = restore_features
|
|
428
|
+
restore_chrom = restore_chrom
|
|
429
|
+
restore_ms2 = restore_ms2
|
|
430
|
+
decompress = decompress
|
|
431
|
+
|
|
432
|
+
# === Reset Operations ===
|
|
433
|
+
fill_reset = fill_reset
|
|
434
|
+
align_reset = align_reset
|
|
435
|
+
|
|
436
|
+
# === Plotting and Visualization ===
|
|
437
|
+
plot_alignment = plot_alignment
|
|
438
|
+
plot_chrom = plot_chrom
|
|
439
|
+
plot_consensus_2d = plot_consensus_2d
|
|
440
|
+
plot_consensus_stats = plot_consensus_stats
|
|
441
|
+
plot_pca = plot_pca
|
|
442
|
+
plot_samples_2d = plot_samples_2d
|
|
443
|
+
plot_bpc = plot_bpc
|
|
444
|
+
plot_rt_correction = plot_rt_correction
|
|
445
|
+
plot_tic = plot_tic
|
|
446
|
+
plot_eic = plot_eic
|
|
447
|
+
|
|
448
|
+
# === Export Operations ===
|
|
449
|
+
export_mgf = export_mgf
|
|
450
|
+
export_mztab = export_mztab
|
|
451
|
+
export_xlsx = export_xlsx
|
|
452
|
+
export_parquet = export_parquet
|
|
453
|
+
|
|
454
|
+
# === Identification and Library Matching ===
|
|
455
|
+
lib_load = lib_load
|
|
456
|
+
identify = identify
|
|
457
|
+
get_id = get_id
|
|
458
|
+
id_reset = id_reset
|
|
459
|
+
lib_reset = lib_reset
|
|
460
|
+
|
|
461
|
+
# === Parameter Management ===
|
|
462
|
+
store_history = store_history
|
|
463
|
+
get_parameters = get_parameters
|
|
464
|
+
update_parameters = update_parameters
|
|
465
|
+
get_parameters_property = get_parameters_property
|
|
466
|
+
set_parameters_property = set_parameters_property
|
|
467
|
+
|
|
468
|
+
# === Private/Internal Methods ===
|
|
426
469
|
_add_samples_batch = _add_samples_batch
|
|
427
470
|
_add_sample_optimized = _add_sample_optimized
|
|
428
471
|
_add_sample_standard = _add_sample_standard
|
|
@@ -434,38 +477,20 @@ class Study:
|
|
|
434
477
|
_get_feature_uids = _get_feature_uids
|
|
435
478
|
_get_sample_uids = _get_sample_uids
|
|
436
479
|
_ensure_features_df_schema_order = _ensure_features_df_schema_order
|
|
437
|
-
get_consensus_matrix = get_consensus_matrix
|
|
438
|
-
get_gaps_matrix = get_gaps_matrix
|
|
439
|
-
get_gaps_stats = get_gaps_stats
|
|
440
|
-
get_orphans = get_orphans
|
|
441
|
-
set_folder = set_folder
|
|
442
|
-
fill = fill
|
|
443
|
-
fill_chrom = fill # Backward compatibility alias
|
|
444
480
|
_process_sample_for_parallel_fill = _process_sample_for_parallel_fill
|
|
445
481
|
_get_missing_consensus_sample_combinations = (
|
|
446
482
|
_get_missing_consensus_sample_combinations
|
|
447
483
|
)
|
|
448
484
|
_load_consensusXML = _load_consensusXML
|
|
449
485
|
load_features = load_features
|
|
450
|
-
sanitize = sanitize
|
|
451
486
|
_save_consensusXML = _save_consensusXML
|
|
452
|
-
|
|
453
|
-
export_mztab = export_mztab
|
|
454
|
-
export_xlsx = export_xlsx
|
|
455
|
-
export_parquet = export_parquet
|
|
456
|
-
_get_mgf_df = _get_mgf_df # New function for MGF data extraction
|
|
457
|
-
# Identification helpers
|
|
458
|
-
lib_load = lib_load
|
|
459
|
-
identify = identify
|
|
460
|
-
get_id = get_id
|
|
461
|
-
id_reset = id_reset
|
|
462
|
-
lib_reset = lib_reset
|
|
487
|
+
_get_mgf_df = _get_mgf_df
|
|
463
488
|
_get_adducts = _get_adducts
|
|
464
489
|
_calculate_formula_mass_shift = _calculate_formula_mass_shift
|
|
465
490
|
_format_adduct_name = _format_adduct_name
|
|
466
491
|
_parse_element_counts = _parse_element_counts
|
|
467
|
-
|
|
468
|
-
#
|
|
492
|
+
|
|
493
|
+
# === Default Parameters ===
|
|
469
494
|
study_defaults = study_defaults
|
|
470
495
|
align_defaults = align_defaults
|
|
471
496
|
export_mgf_defaults = export_mgf_defaults
|
|
@@ -526,7 +551,17 @@ class Study:
|
|
|
526
551
|
):
|
|
527
552
|
sample_modules.append(module_name)
|
|
528
553
|
|
|
529
|
-
|
|
554
|
+
# Add lib submodules
|
|
555
|
+
lib_modules = []
|
|
556
|
+
lib_module_prefix = f"{base_modname}.lib."
|
|
557
|
+
for module_name in sys.modules:
|
|
558
|
+
if (
|
|
559
|
+
module_name.startswith(lib_module_prefix)
|
|
560
|
+
and module_name != current_module
|
|
561
|
+
):
|
|
562
|
+
lib_modules.append(module_name)
|
|
563
|
+
|
|
564
|
+
all_modules_to_reload = core_modules + sample_modules + study_modules + lib_modules
|
|
530
565
|
|
|
531
566
|
# Reload all discovered modules
|
|
532
567
|
for full_module_name in all_modules_to_reload:
|
masster/study/study5_schema.json
CHANGED
|
@@ -99,6 +99,18 @@
|
|
|
99
99
|
},
|
|
100
100
|
"adduct_top": {
|
|
101
101
|
"dtype": "pl.Utf8"
|
|
102
|
+
},
|
|
103
|
+
"id_top_name": {
|
|
104
|
+
"dtype": "pl.String"
|
|
105
|
+
},
|
|
106
|
+
"id_top_class": {
|
|
107
|
+
"dtype": "pl.String"
|
|
108
|
+
},
|
|
109
|
+
"id_top_adduct": {
|
|
110
|
+
"dtype": "pl.String"
|
|
111
|
+
},
|
|
112
|
+
"id_top_score": {
|
|
113
|
+
"dtype": "pl.Float64"
|
|
102
114
|
}
|
|
103
115
|
}
|
|
104
116
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
masster/__init__.py,sha256=8U4cIteNlYyHDrxWSbB_MsDKCX9tds07SJG8-vh8Oa8,738
|
|
2
|
-
masster/_version.py,sha256=
|
|
2
|
+
masster/_version.py,sha256=MHmOhwmhgKcPlEE_VIsCWze2LflhLLxaEnQ5iKr9NXc,257
|
|
3
3
|
masster/chromatogram.py,sha256=iYpdv8C17zVnlWvOFgAn9ns2uFGiF-GgoYf5QVVAbHs,19319
|
|
4
4
|
masster/logger.py,sha256=W50V_uh8RSYwGxDrDFhOuj5jpu2tKJyt_16lMw9kQwA,14755
|
|
5
5
|
masster/spectrum.py,sha256=_upC_g2N9gwTaflXAugs9pSXpKUmzbIehofDordk7WI,47718
|
|
@@ -15,7 +15,7 @@ masster/data/wiff/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecR
|
|
|
15
15
|
masster/data/wiff/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.wiff.scan,sha256=ahi1Y3UhAj9Bj4Q2MlbgPekNdkJvMOoMXVOoR6CeIxc,13881220
|
|
16
16
|
masster/data/wiff/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.wiff2,sha256=TFB0HW4Agkig6yht7FtgjUdbXax8jjKaHpSZSvuU5vs,3252224
|
|
17
17
|
masster/lib/__init__.py,sha256=TcePNx3SYZHz6763TL9Sg4gUNXaRWjlrOtyS6vsu-hg,178
|
|
18
|
-
masster/lib/lib.py,sha256=
|
|
18
|
+
masster/lib/lib.py,sha256=mxUYBCBmkSBZB82557smSHCS25BAusuCewvW8zwsLGg,27130
|
|
19
19
|
masster/sample/__init__.py,sha256=HL0m1ept0PMAYUCQtDDnkdOS12IFl6oLAq4TZQz83uY,170
|
|
20
20
|
masster/sample/adducts.py,sha256=jdtkkiMFeObRv3myluUx--IfpRsEq3-hPgkCb2VUxy4,32590
|
|
21
21
|
masster/sample/h5.py,sha256=7NJeErlIHwC2Qh3nchusLZJWjBGue9zExAx08C89qhg,111889
|
|
@@ -39,15 +39,15 @@ masster/sample/defaults/sample_def.py,sha256=keoXyMyrm_iLgbYqfIbqCpJ3XHBVlNwCNmb
|
|
|
39
39
|
masster/study/__init__.py,sha256=Zspv6U8jFqjkHGYdNdDy1rfUnCSolCzUdgSSg98PRgE,166
|
|
40
40
|
masster/study/export.py,sha256=L-YOUGSgVeTprYnrQxaN0qC8MRqUdDQ0D4o2h7HLi2Q,54813
|
|
41
41
|
masster/study/h5.py,sha256=Sbde1cxAAIq0EjNiTxQgJgHHVKFw29q510YBJRa_egw,83691
|
|
42
|
-
masster/study/helpers.py,sha256=
|
|
43
|
-
masster/study/id.py,sha256=
|
|
42
|
+
masster/study/helpers.py,sha256=M5_q8O5tuFchKPW04PTuj3X335lDA2VZqcs4D8ZQJEk,158604
|
|
43
|
+
masster/study/id.py,sha256=V2R2L3NtiPvl1STDOonBbYGtHikeN0VGH78ruUNhgNE,55263
|
|
44
44
|
masster/study/load.py,sha256=tK3ueWxrauyveZukyh1YaV8h8fSFDytLnTmrEpFvcwU,70458
|
|
45
45
|
masster/study/parameters.py,sha256=0elaF7YspTsB7qyajWAbRNL2VfKlGz5GJLifmO8IGkk,3276
|
|
46
|
-
masster/study/plot.py,sha256=
|
|
47
|
-
masster/study/processing.py,sha256=
|
|
46
|
+
masster/study/plot.py,sha256=Wp48DH5x1t8w6R67AMjxLaUIKZpDa82fnUoAgEeNY5E,87564
|
|
47
|
+
masster/study/processing.py,sha256=uq9PzZeHd2UgSfvB8wMHkeOROS8hcs8_cfNnyE4fGk0,77144
|
|
48
48
|
masster/study/save.py,sha256=F_H34zmvxV54Ds64ju90JJLy_F4hg6nRdHhJ9ssWKLA,6704
|
|
49
|
-
masster/study/study.py,sha256=
|
|
50
|
-
masster/study/study5_schema.json,sha256=
|
|
49
|
+
masster/study/study.py,sha256=ILKZBbLrno0vPbaLLUwhROIyAk0w9l2k9PxSqeTyR3E,35761
|
|
50
|
+
masster/study/study5_schema.json,sha256=c0w24QdHak01m04I1VPu97KvF2468FcaqROhf6pmLk4,7507
|
|
51
51
|
masster/study/defaults/__init__.py,sha256=m3Z5KXGqsTdh7GjYzZoENERt39yRg0ceVRV1DeCt1P0,610
|
|
52
52
|
masster/study/defaults/align_def.py,sha256=hHQbGgsOqMRHHr0Wn8Onr8XeaRz3-fFE0qGE-OMst80,20324
|
|
53
53
|
masster/study/defaults/export_def.py,sha256=eXl3h4aoLX88XkHTpqahLd-QZ2gjUqrmjq8IJULXeWo,1203
|
|
@@ -60,8 +60,8 @@ masster/study/defaults/integrate_chrom_def.py,sha256=0MNIWGTjty-Zu-NTQsIweuj3UVq
|
|
|
60
60
|
masster/study/defaults/integrate_def.py,sha256=Vf4SAzdBfnsSZ3IRaF0qZvWu3gMDPHdgPfMYoPKeWv8,7246
|
|
61
61
|
masster/study/defaults/merge_def.py,sha256=EBsKE3hsAkTEzN9dpdRD5W3_suTKy_WZ_96rwS0uBuE,8572
|
|
62
62
|
masster/study/defaults/study_def.py,sha256=h8dYbi9xv0sesCSQik49Z53IkskMmNtW6ixl7it5pL0,16033
|
|
63
|
-
masster-0.4.
|
|
64
|
-
masster-0.4.
|
|
65
|
-
masster-0.4.
|
|
66
|
-
masster-0.4.
|
|
67
|
-
masster-0.4.
|
|
63
|
+
masster-0.4.13.dist-info/METADATA,sha256=KTpKcb0p9FjiqMLyZ1LzXPsiJCugLbevYuIzEDj6Qq8,44189
|
|
64
|
+
masster-0.4.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
65
|
+
masster-0.4.13.dist-info/entry_points.txt,sha256=ZHguQ_vPmdbpqq2uGtmEOLJfgP-DQ1T0c07Lxh30wc8,58
|
|
66
|
+
masster-0.4.13.dist-info/licenses/LICENSE,sha256=bx5iLIKjgAdYQ7sISn7DsfHRKkoCUm1154sJJKhgqnU,35184
|
|
67
|
+
masster-0.4.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|