masster 0.5.23__tar.gz → 0.5.24__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.

Files changed (88) hide show
  1. {masster-0.5.23 → masster-0.5.24}/PKG-INFO +1 -1
  2. {masster-0.5.23 → masster-0.5.24}/pyproject.toml +1 -1
  3. {masster-0.5.23 → masster-0.5.24}/src/masster/_version.py +1 -1
  4. {masster-0.5.23 → masster-0.5.24}/src/masster/study/h5.py +35 -8
  5. {masster-0.5.23 → masster-0.5.24}/src/masster/wizard/wizard.py +2 -2
  6. {masster-0.5.23 → masster-0.5.24}/uv.lock +1 -1
  7. {masster-0.5.23 → masster-0.5.24}/.github/workflows/publish.yml +0 -0
  8. {masster-0.5.23 → masster-0.5.24}/.github/workflows/security.yml +0 -0
  9. {masster-0.5.23 → masster-0.5.24}/.github/workflows/test.yml +0 -0
  10. {masster-0.5.23 → masster-0.5.24}/.gitignore +0 -0
  11. {masster-0.5.23 → masster-0.5.24}/.pre-commit-config.yaml +0 -0
  12. {masster-0.5.23 → masster-0.5.24}/LICENSE +0 -0
  13. {masster-0.5.23 → masster-0.5.24}/Makefile +0 -0
  14. {masster-0.5.23 → masster-0.5.24}/README.md +0 -0
  15. {masster-0.5.23 → masster-0.5.24}/demo/example_batch_process.py +0 -0
  16. {masster-0.5.23 → masster-0.5.24}/demo/example_sample_process.py +0 -0
  17. {masster-0.5.23 → masster-0.5.24}/src/masster/__init__.py +0 -0
  18. {masster-0.5.23 → masster-0.5.24}/src/masster/chromatogram.py +0 -0
  19. {masster-0.5.23 → masster-0.5.24}/src/masster/data/libs/aa.csv +0 -0
  20. {masster-0.5.23 → masster-0.5.24}/src/masster/data/libs/ccm.csv +0 -0
  21. {masster-0.5.23 → masster-0.5.24}/src/masster/data/libs/urine.csv +0 -0
  22. {masster-0.5.23 → masster-0.5.24}/src/masster/data/wiff/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.timeseries.data +0 -0
  23. {masster-0.5.23 → masster-0.5.24}/src/masster/data/wiff/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.wiff +0 -0
  24. {masster-0.5.23 → masster-0.5.24}/src/masster/data/wiff/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.wiff.scan +0 -0
  25. {masster-0.5.23 → masster-0.5.24}/src/masster/data/wiff/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.wiff2 +0 -0
  26. {masster-0.5.23 → masster-0.5.24}/src/masster/lib/__init__.py +0 -0
  27. {masster-0.5.23 → masster-0.5.24}/src/masster/lib/lib.py +0 -0
  28. {masster-0.5.23 → masster-0.5.24}/src/masster/logger.py +0 -0
  29. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/__init__.py +0 -0
  30. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/adducts.py +0 -0
  31. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/defaults/__init__.py +0 -0
  32. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/defaults/find_adducts_def.py +0 -0
  33. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/defaults/find_features_def.py +0 -0
  34. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/defaults/find_ms2_def.py +0 -0
  35. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/defaults/get_spectrum_def.py +0 -0
  36. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/defaults/sample_def.py +0 -0
  37. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/h5.py +0 -0
  38. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/helpers.py +0 -0
  39. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/lib.py +0 -0
  40. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/load.py +0 -0
  41. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/parameters.py +0 -0
  42. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/plot.py +0 -0
  43. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/processing.py +0 -0
  44. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/quant.py +0 -0
  45. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/sample.py +0 -0
  46. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/sample5_schema.json +0 -0
  47. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/save.py +0 -0
  48. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/sciex.py +0 -0
  49. {masster-0.5.23 → masster-0.5.24}/src/masster/sample/thermo.py +0 -0
  50. {masster-0.5.23 → masster-0.5.24}/src/masster/spectrum.py +0 -0
  51. {masster-0.5.23 → masster-0.5.24}/src/masster/study/__init__.py +0 -0
  52. {masster-0.5.23 → masster-0.5.24}/src/masster/study/analysis.py +0 -0
  53. {masster-0.5.23 → masster-0.5.24}/src/masster/study/defaults/__init__.py +0 -0
  54. {masster-0.5.23 → masster-0.5.24}/src/masster/study/defaults/align_def.py +0 -0
  55. {masster-0.5.23 → masster-0.5.24}/src/masster/study/defaults/export_def.py +0 -0
  56. {masster-0.5.23 → masster-0.5.24}/src/masster/study/defaults/fill_def.py +0 -0
  57. {masster-0.5.23 → masster-0.5.24}/src/masster/study/defaults/find_consensus_def.py +0 -0
  58. {masster-0.5.23 → masster-0.5.24}/src/masster/study/defaults/find_ms2_def.py +0 -0
  59. {masster-0.5.23 → masster-0.5.24}/src/masster/study/defaults/identify_def.py +0 -0
  60. {masster-0.5.23 → masster-0.5.24}/src/masster/study/defaults/integrate_chrom_def.py +0 -0
  61. {masster-0.5.23 → masster-0.5.24}/src/masster/study/defaults/integrate_def.py +0 -0
  62. {masster-0.5.23 → masster-0.5.24}/src/masster/study/defaults/merge_def.py +0 -0
  63. {masster-0.5.23 → masster-0.5.24}/src/masster/study/defaults/study_def.py +0 -0
  64. {masster-0.5.23 → masster-0.5.24}/src/masster/study/export.py +0 -0
  65. {masster-0.5.23 → masster-0.5.24}/src/masster/study/helpers.py +0 -0
  66. {masster-0.5.23 → masster-0.5.24}/src/masster/study/id.py +0 -0
  67. {masster-0.5.23 → masster-0.5.24}/src/masster/study/importers.py +0 -0
  68. {masster-0.5.23 → masster-0.5.24}/src/masster/study/load.py +0 -0
  69. {masster-0.5.23 → masster-0.5.24}/src/masster/study/merge.py +0 -0
  70. {masster-0.5.23 → masster-0.5.24}/src/masster/study/parameters.py +0 -0
  71. {masster-0.5.23 → masster-0.5.24}/src/masster/study/plot.py +0 -0
  72. {masster-0.5.23 → masster-0.5.24}/src/masster/study/processing.py +0 -0
  73. {masster-0.5.23 → masster-0.5.24}/src/masster/study/save.py +0 -0
  74. {masster-0.5.23 → masster-0.5.24}/src/masster/study/study.py +0 -0
  75. {masster-0.5.23 → masster-0.5.24}/src/masster/study/study5_schema.json +0 -0
  76. {masster-0.5.23 → masster-0.5.24}/src/masster/wizard/__init__.py +0 -0
  77. {masster-0.5.23 → masster-0.5.24}/tests/conftest.py +0 -0
  78. {masster-0.5.23 → masster-0.5.24}/tests/test_chromatogram.py +0 -0
  79. {masster-0.5.23 → masster-0.5.24}/tests/test_defaults.py +0 -0
  80. {masster-0.5.23 → masster-0.5.24}/tests/test_imports.py +0 -0
  81. {masster-0.5.23 → masster-0.5.24}/tests/test_integration.py +0 -0
  82. {masster-0.5.23 → masster-0.5.24}/tests/test_logger.py +0 -0
  83. {masster-0.5.23 → masster-0.5.24}/tests/test_parameters.py +0 -0
  84. {masster-0.5.23 → masster-0.5.24}/tests/test_sample.py +0 -0
  85. {masster-0.5.23 → masster-0.5.24}/tests/test_spectrum.py +0 -0
  86. {masster-0.5.23 → masster-0.5.24}/tests/test_study.py +0 -0
  87. {masster-0.5.23 → masster-0.5.24}/tests/test_version.py +0 -0
  88. {masster-0.5.23 → masster-0.5.24}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: masster
3
- Version: 0.5.23
3
+ Version: 0.5.24
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
@@ -1,7 +1,7 @@
1
1
 
2
2
  [project]
3
3
  name = "masster"
4
- version = "0.5.23"
4
+ version = "0.5.24"
5
5
  description = "Mass spectrometry data analysis package"
6
6
  authors = [
7
7
  { name = "Zamboni Lab" }
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
 
4
- __version__ = "0.5.23"
4
+ __version__ = "0.5.24"
5
5
 
6
6
 
7
7
  def get_version():
@@ -717,11 +717,33 @@ def _reconstruct_object_column(data_col, col_name: str):
717
717
  # Handle isotope patterns (numpy arrays with [mz, intensity] data)
718
718
  try:
719
719
  import numpy as np
720
-
721
- iso_data = json.loads(item)
722
- # Convert back to numpy array
723
- reconstructed_data.append(np.array(iso_data) if iso_data else None)
724
- except (json.JSONDecodeError, ValueError, ImportError):
720
+
721
+ # Try JSON parsing first (new format)
722
+ try:
723
+ iso_data = json.loads(item)
724
+ # Convert back to numpy array
725
+ reconstructed_data.append(np.array(iso_data) if iso_data else None)
726
+ except json.JSONDecodeError:
727
+ # Handle numpy array string representation (old format)
728
+ # This handles strings like "[[ 875.7865 447675. ]\n [ 876.7902 168819. ]]"
729
+ try:
730
+ # Use numpy's string representation parser
731
+ iso_array = np.fromstring(item.replace('[', '').replace(']', '').replace('\n', ' '), sep=' ')
732
+ # Reshape to 2D array (pairs of mz, intensity)
733
+ if len(iso_array) % 2 == 0:
734
+ iso_array = iso_array.reshape(-1, 2)
735
+ reconstructed_data.append(iso_array)
736
+ else:
737
+ reconstructed_data.append(None)
738
+ except (ValueError, AttributeError):
739
+ # If all else fails, try to evaluate the string as a literal
740
+ try:
741
+ import ast
742
+ iso_data = ast.literal_eval(item)
743
+ reconstructed_data.append(np.array(iso_data) if iso_data else None)
744
+ except (ValueError, SyntaxError):
745
+ reconstructed_data.append(None)
746
+ except (ValueError, ImportError):
725
747
  reconstructed_data.append(None)
726
748
  elif col_name == "ms1_spec":
727
749
  # Handle MS1 spectra patterns (numpy arrays with [mz, intensity] data)
@@ -1952,10 +1974,15 @@ def _load_study5(self, filename=None):
1952
1974
  f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]} | INFO | {self.log_label}Loading consensus",
1953
1975
  )
1954
1976
  if "consensus" in f and len(f["consensus"].keys()) > 0:
1955
- # Only include adducts in object_columns if it actually exists in the file
1977
+ # Only include object columns if they actually exist in the file
1956
1978
  object_columns = []
1957
- if "adducts" in f["consensus"]:
1958
- object_columns.append("adducts")
1979
+ try:
1980
+ if "adducts" in f["consensus"]:
1981
+ object_columns.append("adducts")
1982
+ if "iso" in f["consensus"]:
1983
+ object_columns.append("iso")
1984
+ except (KeyError, TypeError):
1985
+ pass
1959
1986
 
1960
1987
  self.consensus_df = _load_dataframe_from_group(
1961
1988
  f["consensus"],
@@ -526,7 +526,7 @@ class Wizard:
526
526
  " # === Processing Parameters ===",
527
527
  f' "adducts": {self.params.adducts!r}, # Adduct specifications for feature detection and annotation',
528
528
  f' "noise": {noise}, # Noise threshold for feature detection',
529
- f' "chrom_fwhm": {self.params.chrom_fwhm}, # Chromatographic peak full width at half maximum (seconds)',
529
+ f' "chrom_fwhm": {chrom_fwhm}, # Chromatographic peak full width at half maximum (seconds)',
530
530
  f' "chrom_peak_snr": {self.params.chrom_peak_snr}, # Minimum signal-to-noise ratio for chromatographic peaks',
531
531
  "",
532
532
  " # === Alignment & Merging ===",
@@ -1267,7 +1267,7 @@ class Wizard:
1267
1267
  " )",
1268
1268
  " sample.find_adducts(adducts=PARAMS['adducts'])",
1269
1269
  " sample.find_ms2()",
1270
- " # sample.find_iso()",
1270
+ " sample.find_iso()",
1271
1271
  " # sample.export_mgf()",
1272
1272
  " # sample.export_mztab()",
1273
1273
  ' # sample.plot_2d(filename="{sample_name}.html")',
@@ -1473,7 +1473,7 @@ wheels = [
1473
1473
 
1474
1474
  [[package]]
1475
1475
  name = "masster"
1476
- version = "0.5.23"
1476
+ version = "0.5.24"
1477
1477
  source = { editable = "." }
1478
1478
  dependencies = [
1479
1479
  { name = "alpharaw" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes