masster 0.6.0__tar.gz → 0.6.1__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 (70) hide show
  1. {masster-0.6.0 → masster-0.6.1}/PKG-INFO +3 -2
  2. {masster-0.6.0 → masster-0.6.1}/README.md +1 -0
  3. {masster-0.6.0 → masster-0.6.1}/pyproject.toml +2 -2
  4. {masster-0.6.0 → masster-0.6.1}/src/masster/_version.py +1 -1
  5. {masster-0.6.0 → masster-0.6.1}/src/masster/study/export.py +62 -62
  6. {masster-0.6.0 → masster-0.6.1}/.gitignore +0 -0
  7. {masster-0.6.0 → masster-0.6.1}/LICENSE +0 -0
  8. {masster-0.6.0 → masster-0.6.1}/THIRD_PARTY_NOTICES.md +0 -0
  9. {masster-0.6.0 → masster-0.6.1}/src/masster/__init__.py +0 -0
  10. {masster-0.6.0 → masster-0.6.1}/src/masster/chromatogram.py +0 -0
  11. {masster-0.6.0 → masster-0.6.1}/src/masster/data/libs/aa_nort.json +0 -0
  12. {masster-0.6.0 → masster-0.6.1}/src/masster/data/libs/ccm_nort.json +0 -0
  13. {masster-0.6.0 → masster-0.6.1}/src/masster/data/wiff/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.timeseries.data +0 -0
  14. {masster-0.6.0 → masster-0.6.1}/src/masster/data/wiff/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.wiff +0 -0
  15. {masster-0.6.0 → masster-0.6.1}/src/masster/data/wiff/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.wiff.scan +0 -0
  16. {masster-0.6.0 → masster-0.6.1}/src/masster/data/wiff/2025_01_14_VW_7600_LpMx_DBS_CID_2min_TOP15_030msecMS1_005msecReac_CE35_DBS-ON_3.wiff2 +0 -0
  17. {masster-0.6.0 → masster-0.6.1}/src/masster/lib/__init__.py +0 -0
  18. {masster-0.6.0 → masster-0.6.1}/src/masster/lib/lib.py +0 -0
  19. {masster-0.6.0 → masster-0.6.1}/src/masster/logger.py +0 -0
  20. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/__init__.py +0 -0
  21. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/adducts.py +0 -0
  22. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/defaults/__init__.py +0 -0
  23. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/defaults/find_adducts_def.py +0 -0
  24. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/defaults/find_features_def.py +0 -0
  25. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/defaults/find_ms2_def.py +0 -0
  26. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/defaults/get_spectrum_def.py +0 -0
  27. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/defaults/sample_def.py +0 -0
  28. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/h5.py +0 -0
  29. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/helpers.py +0 -0
  30. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/id.py +0 -0
  31. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/importers.py +0 -0
  32. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/lib.py +0 -0
  33. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/load.py +0 -0
  34. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/parameters.py +0 -0
  35. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/plot.py +0 -0
  36. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/processing.py +0 -0
  37. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/quant.py +0 -0
  38. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/sample.py +0 -0
  39. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/sample5_schema.json +0 -0
  40. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/save.py +0 -0
  41. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/sciex.py +0 -0
  42. {masster-0.6.0 → masster-0.6.1}/src/masster/sample/thermo.py +0 -0
  43. {masster-0.6.0 → masster-0.6.1}/src/masster/spectrum.py +0 -0
  44. {masster-0.6.0 → masster-0.6.1}/src/masster/study/__init__.py +0 -0
  45. {masster-0.6.0 → masster-0.6.1}/src/masster/study/analysis.py +0 -0
  46. {masster-0.6.0 → masster-0.6.1}/src/masster/study/defaults/__init__.py +0 -0
  47. {masster-0.6.0 → masster-0.6.1}/src/masster/study/defaults/align_def.py +0 -0
  48. {masster-0.6.0 → masster-0.6.1}/src/masster/study/defaults/export_def.py +0 -0
  49. {masster-0.6.0 → masster-0.6.1}/src/masster/study/defaults/fill_def.py +0 -0
  50. {masster-0.6.0 → masster-0.6.1}/src/masster/study/defaults/find_consensus_def.py +0 -0
  51. {masster-0.6.0 → masster-0.6.1}/src/masster/study/defaults/find_ms2_def.py +0 -0
  52. {masster-0.6.0 → masster-0.6.1}/src/masster/study/defaults/identify_def.py +0 -0
  53. {masster-0.6.0 → masster-0.6.1}/src/masster/study/defaults/integrate_chrom_def.py +0 -0
  54. {masster-0.6.0 → masster-0.6.1}/src/masster/study/defaults/integrate_def.py +0 -0
  55. {masster-0.6.0 → masster-0.6.1}/src/masster/study/defaults/merge_def.py +0 -0
  56. {masster-0.6.0 → masster-0.6.1}/src/masster/study/defaults/study_def.py +0 -0
  57. {masster-0.6.0 → masster-0.6.1}/src/masster/study/h5.py +0 -0
  58. {masster-0.6.0 → masster-0.6.1}/src/masster/study/helpers.py +0 -0
  59. {masster-0.6.0 → masster-0.6.1}/src/masster/study/id.py +0 -0
  60. {masster-0.6.0 → masster-0.6.1}/src/masster/study/importers.py +0 -0
  61. {masster-0.6.0 → masster-0.6.1}/src/masster/study/load.py +0 -0
  62. {masster-0.6.0 → masster-0.6.1}/src/masster/study/merge.py +0 -0
  63. {masster-0.6.0 → masster-0.6.1}/src/masster/study/parameters.py +0 -0
  64. {masster-0.6.0 → masster-0.6.1}/src/masster/study/plot.py +0 -0
  65. {masster-0.6.0 → masster-0.6.1}/src/masster/study/processing.py +0 -0
  66. {masster-0.6.0 → masster-0.6.1}/src/masster/study/save.py +0 -0
  67. {masster-0.6.0 → masster-0.6.1}/src/masster/study/study.py +0 -0
  68. {masster-0.6.0 → masster-0.6.1}/src/masster/study/study5_schema.json +0 -0
  69. {masster-0.6.0 → masster-0.6.1}/src/masster/wizard/__init__.py +0 -0
  70. {masster-0.6.0 → masster-0.6.1}/src/masster/wizard/wizard.py +0 -0
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: masster
3
- Version: 0.6.0
3
+ Version: 0.6.1
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
7
7
  Project-URL: documentation, https://github.com/zamboni-lab/masster#readme
8
8
  Project-URL: Third-Party Licenses, https://github.com/zamboni-lab/masster/blob/main/THIRD_PARTY_NOTICES.md
9
- Author: Zamboni Lab
9
+ Author: Zamboni Lab, ETH Zurich
10
10
  License: GNU AFFERO GENERAL PUBLIC LICENSE
11
11
  Version 3, 19 November 2007
12
12
 
@@ -833,6 +833,7 @@ study.save()
833
833
  study.plot_samples_pca()
834
834
  study.plot_samples_umap()
835
835
  study.plot_samples_2d()
836
+ study.plot_heatmap()
836
837
 
837
838
  # To know more about the available methods...
838
839
  dir(study)
@@ -105,6 +105,7 @@ study.save()
105
105
  study.plot_samples_pca()
106
106
  study.plot_samples_umap()
107
107
  study.plot_samples_2d()
108
+ study.plot_heatmap()
108
109
 
109
110
  # To know more about the available methods...
110
111
  dir(study)
@@ -1,10 +1,10 @@
1
1
 
2
2
  [project]
3
3
  name = "masster"
4
- version = "0.6.0"
4
+ version = "0.6.1"
5
5
  description = "Mass spectrometry data analysis package"
6
6
  authors = [
7
- { name = "Zamboni Lab" }
7
+ { name = "Zamboni Lab, ETH Zurich" }
8
8
  ]
9
9
  license = { file = "LICENSE" }
10
10
  readme = "README.md"
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
 
4
- __version__ = "0.5.26"
4
+ __version__ = "0.6.1"
5
5
 
6
6
 
7
7
  def get_version():
@@ -524,7 +524,7 @@ def export_mztab(self, filename: str | None = None, include_mgf=True, **kwargs)
524
524
  # Import here to avoid circular imports
525
525
  from masster.study.id import get_id
526
526
 
527
- # Get full enriched identification data for SOME section
527
+ # Get full enriched identification data for SME section
528
528
  full_id_data = get_id(self)
529
529
  if full_id_data is not None and not full_id_data.is_empty():
530
530
  # Get top scoring identification for each consensus_uid for SML section
@@ -828,8 +828,8 @@ def export_mztab(self, filename: str | None = None, include_mgf=True, **kwargs)
828
828
  smf_header = [
829
829
  "SFH",
830
830
  "SMF_ID",
831
- "SOME_ID_REFS",
832
- "SOME_ID_REF_ambiguity_code",
831
+ "SME_ID_REFS",
832
+ "SME_ID_REF_ambiguity_code",
833
833
  "adduct_ion",
834
834
  "isotopomer",
835
835
  "exp_mass_to_charge",
@@ -847,40 +847,40 @@ def export_mztab(self, filename: str | None = None, include_mgf=True, **kwargs)
847
847
 
848
848
  # SMF table uses the same consensus features as SML, just different metadata
849
849
  for idx, row in enumerate(self.consensus_df.iter_rows(named=True), 1):
850
- # References to SOME entries - each SMF can reference multiple SOME entries for the same consensus_uid
851
- some_refs = "null"
852
- some_ambiguity = "null"
850
+ # References to SME entries - each SMF can reference multiple SME entries for the same consensus_uid
851
+ SME_refs = "null"
852
+ SME_ambiguity = "null"
853
853
  consensus_uid = row["consensus_uid"]
854
854
 
855
855
  if full_id_data is not None:
856
- # Find all SOME entries for this consensus_uid
857
- some_matches = full_id_data.filter(pl.col("consensus_uid") == consensus_uid)
858
- if some_matches.height > 0:
859
- # Generate SOME IDs - we'll create a mapping in the SOME section
856
+ # Find all SME entries for this consensus_uid
857
+ SME_matches = full_id_data.filter(pl.col("consensus_uid") == consensus_uid)
858
+ if SME_matches.height > 0:
859
+ # Generate SME IDs - we'll create a mapping in the SME section
860
860
  # For now, use a simple approach based on consensus_uid and lib_uid
861
- some_ids = []
862
- for i, some_row in enumerate(some_matches.iter_rows(named=True)):
863
- # Create a unique SOME ID based on consensus_uid and position
864
- some_id_base = consensus_uid * 1000 # Ensure uniqueness across consensus features
865
- some_id = some_id_base + i + 1
866
- some_ids.append(str(some_id))
867
-
868
- if some_ids:
869
- some_refs = "|".join(some_ids)
861
+ SME_ids = []
862
+ for i, SME_row in enumerate(SME_matches.iter_rows(named=True)):
863
+ # Create a unique SME ID based on consensus_uid and position
864
+ SME_id_base = consensus_uid * 1000 # Ensure uniqueness across consensus features
865
+ SME_id = SME_id_base + i + 1
866
+ SME_ids.append(str(SME_id))
867
+
868
+ if SME_ids:
869
+ SME_refs = "|".join(SME_ids)
870
870
  # Set ambiguity code: 1=ambiguous identification, 2=multiple evidence same molecule, 3=both
871
- if len(some_ids) > 1:
871
+ if len(SME_ids) > 1:
872
872
  # Check if all identifications point to the same compound
873
873
  unique_cmpds = {
874
874
  match["cmpd_uid"]
875
- for match in some_matches.iter_rows(named=True)
875
+ for match in SME_matches.iter_rows(named=True)
876
876
  if match.get("cmpd_uid") is not None
877
877
  }
878
878
  if len(unique_cmpds) > 1:
879
- some_ambiguity = "1" # Ambiguous identification
879
+ SME_ambiguity = "1" # Ambiguous identification
880
880
  else:
881
- some_ambiguity = "2" # Multiple evidence for same molecule
881
+ SME_ambiguity = "2" # Multiple evidence for same molecule
882
882
  else:
883
- some_ambiguity = "null"
883
+ SME_ambiguity = "null"
884
884
 
885
885
  # Format isotopomer according to mzTab-M specification
886
886
  iso_value = row.get("iso_mean", 0)
@@ -892,8 +892,8 @@ def export_mztab(self, filename: str | None = None, include_mgf=True, **kwargs)
892
892
  smf_row = [
893
893
  "SMF",
894
894
  str(idx),
895
- some_refs,
896
- some_ambiguity,
895
+ SME_refs,
896
+ SME_ambiguity,
897
897
  adduct_list[idx - 1], # adduct_ion
898
898
  isotopomer, # isotopomer formatted according to mzTab-M specification
899
899
  safe_str(row.get("mz", "null")), # exp_mass_to_charge
@@ -943,16 +943,16 @@ def export_mztab(self, filename: str | None = None, include_mgf=True, **kwargs)
943
943
  for line in smf_lines:
944
944
  f.write(line + "\n")
945
945
 
946
- # --- SOME (Small Molecule Evidence) table ---
946
+ # --- SME (Small Molecule Evidence) table ---
947
947
  if full_id_data is not None and not full_id_data.is_empty():
948
- some_lines = []
948
+ SME_lines = []
949
949
  # Add comment about spectra_ref being dummy placeholders
950
- some_lines.append(
950
+ SME_lines.append(
951
951
  "COM\tThe spectra_ref are dummy placeholders, as the annotation was based on aggregated data",
952
952
  )
953
- some_header = [
954
- "SHE",
955
- "SOME_ID",
953
+ SME_header = [
954
+ "SEH",
955
+ "SME_ID",
956
956
  "evidence_input_id",
957
957
  "database_identifier",
958
958
  "chemical_formula",
@@ -971,9 +971,9 @@ def export_mztab(self, filename: str | None = None, include_mgf=True, **kwargs)
971
971
  "id_confidence_measure[1]",
972
972
  "rank",
973
973
  ]
974
- some_lines.append("\t".join(some_header))
974
+ SME_lines.append("\t".join(SME_header))
975
975
 
976
- # Create SOME entries for all identification results using enriched data
976
+ # Create SME entries for all identification results using enriched data
977
977
  for consensus_uid in self.consensus_df.select("consensus_uid").to_series().unique():
978
978
  # Get consensus feature data for this consensus_uid
979
979
  consensus_feature_data = self.consensus_df.filter(
@@ -984,16 +984,16 @@ def export_mztab(self, filename: str | None = None, include_mgf=True, **kwargs)
984
984
  consensus_row = consensus_feature_data.row(0, named=True)
985
985
 
986
986
  # Get all identification results for this consensus feature from enriched data
987
- some_matches = full_id_data.filter(pl.col("consensus_uid") == consensus_uid)
987
+ SME_matches = full_id_data.filter(pl.col("consensus_uid") == consensus_uid)
988
988
 
989
- if some_matches.height > 0:
989
+ if SME_matches.height > 0:
990
990
  # Sort by score descending to maintain rank order
991
- some_matches = some_matches.sort("score", descending=True)
991
+ SME_matches = SME_matches.sort("score", descending=True)
992
992
 
993
- for i, some_row in enumerate(some_matches.iter_rows(named=True)):
994
- # Generate unique SOME_ID
995
- some_id_base = consensus_uid * 1000
996
- some_id = some_id_base + i + 1
993
+ for i, SME_row in enumerate(SME_matches.iter_rows(named=True)):
994
+ # Generate unique SME_ID
995
+ SME_id_base = consensus_uid * 1000
996
+ SME_id = SME_id_base + i + 1
997
997
 
998
998
  # Create evidence input ID using consensus_uid:mz:rt format
999
999
  consensus_mz = consensus_row.get("mz", 0)
@@ -1002,15 +1002,15 @@ def export_mztab(self, filename: str | None = None, include_mgf=True, **kwargs)
1002
1002
 
1003
1003
  # Database identifier - use db_id if available, otherwise fallback to cmpd_uid
1004
1004
  db_id = "null"
1005
- if some_row.get("db_id") is not None and some_row["db_id"] != "":
1006
- db_id = safe_str(some_row["db_id"])
1007
- elif some_row.get("cmpd_uid") is not None:
1008
- db_id = f"cmpd:{some_row['cmpd_uid']}"
1005
+ if SME_row.get("db_id") is not None and SME_row["db_id"] != "":
1006
+ db_id = safe_str(SME_row["db_id"])
1007
+ elif SME_row.get("cmpd_uid") is not None:
1008
+ db_id = f"cmpd:{SME_row['cmpd_uid']}"
1009
1009
 
1010
1010
  # Get adduct information
1011
1011
  adduct_ion = "null"
1012
- if some_row.get("adduct") is not None and some_row["adduct"] != "":
1013
- adduct_ion = safe_str(some_row["adduct"])
1012
+ if SME_row.get("adduct") is not None and SME_row["adduct"] != "":
1013
+ adduct_ion = safe_str(SME_row["adduct"])
1014
1014
  # Replace ? with H for better mzTab compatibility
1015
1015
  adduct_ion = adduct_ion.replace("?", "H")
1016
1016
 
@@ -1019,8 +1019,8 @@ def export_mztab(self, filename: str | None = None, include_mgf=True, **kwargs)
1019
1019
 
1020
1020
  # Identification method
1021
1021
  id_method = "[MS, MS:1002888, small molecule confidence measure, ]"
1022
- if some_row.get("matcher") is not None:
1023
- id_method = f"[MS, MS:1002888, {some_row['matcher']}, ]"
1022
+ if SME_row.get("matcher") is not None:
1023
+ id_method = f"[MS, MS:1002888, {SME_row['matcher']}, ]"
1024
1024
 
1025
1025
  # MS level - assume MS1 for now
1026
1026
  ms_level = "[MS, MS:1000511, ms level, 1]"
@@ -1030,18 +1030,18 @@ def export_mztab(self, filename: str | None = None, include_mgf=True, **kwargs)
1030
1030
 
1031
1031
  # Theoretical mass-to-charge from lib_df
1032
1032
  theoretical_mz = "null"
1033
- if some_row.get("mz") is not None: # This comes from lib_df via get_id() join
1034
- theoretical_mz = safe_str(some_row["mz"])
1033
+ if SME_row.get("mz") is not None: # This comes from lib_df via get_id() join
1034
+ theoretical_mz = safe_str(SME_row["mz"])
1035
1035
 
1036
- some_line = [
1037
- "SOME",
1038
- str(some_id),
1036
+ SME_line = [
1037
+ "SME",
1038
+ str(SME_id),
1039
1039
  evidence_id,
1040
1040
  db_id,
1041
- safe_str(some_row.get("formula", "null")),
1042
- safe_str(some_row.get("smiles", "null")),
1043
- safe_str(some_row.get("inchi", "null")),
1044
- safe_str(some_row.get("name", "null")),
1041
+ safe_str(SME_row.get("formula", "null")),
1042
+ safe_str(SME_row.get("smiles", "null")),
1043
+ safe_str(SME_row.get("inchi", "null")),
1044
+ safe_str(SME_row.get("name", "null")),
1045
1045
  "null", # uri - not available in current data
1046
1046
  "null", # derivatized_form
1047
1047
  adduct_ion,
@@ -1053,15 +1053,15 @@ def export_mztab(self, filename: str | None = None, include_mgf=True, **kwargs)
1053
1053
  spectra_ref,
1054
1054
  id_method,
1055
1055
  ms_level,
1056
- safe_str(some_row.get("score", "null")),
1056
+ safe_str(SME_row.get("score", "null")),
1057
1057
  str(i + 1), # rank within this consensus feature
1058
1058
  ]
1059
- some_lines.append("\t".join(some_line))
1059
+ SME_lines.append("\t".join(SME_line))
1060
1060
 
1061
- # Write SOME table
1061
+ # Write SME table
1062
1062
  with open(filename, "a", encoding="utf-8") as f:
1063
1063
  f.write("\n")
1064
- for line in some_lines:
1064
+ for line in SME_lines:
1065
1065
  f.write(line + "\n")
1066
1066
 
1067
1067
  # --- MGF table ---
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