masscube 1.2.7__tar.gz → 1.2.8__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.
Files changed (27) hide show
  1. {masscube-1.2.7 → masscube-1.2.8}/PKG-INFO +1 -1
  2. {masscube-1.2.7 → masscube-1.2.8}/pyproject.toml +1 -1
  3. {masscube-1.2.7 → masscube-1.2.8}/src/masscube/alignment.py +5 -2
  4. {masscube-1.2.7 → masscube-1.2.8}/src/masscube/stats.py +2 -1
  5. {masscube-1.2.7 → masscube-1.2.8}/src/masscube/workflows.py +1 -1
  6. {masscube-1.2.7 → masscube-1.2.8}/src/masscube.egg-info/PKG-INFO +1 -1
  7. {masscube-1.2.7 → masscube-1.2.8}/LICENSE +0 -0
  8. {masscube-1.2.7 → masscube-1.2.8}/README.md +0 -0
  9. {masscube-1.2.7 → masscube-1.2.8}/setup.cfg +0 -0
  10. {masscube-1.2.7 → masscube-1.2.8}/src/masscube/__init__.py +0 -0
  11. {masscube-1.2.7 → masscube-1.2.8}/src/masscube/annotation.py +0 -0
  12. {masscube-1.2.7 → masscube-1.2.8}/src/masscube/classifier_builder.py +0 -0
  13. {masscube-1.2.7 → masscube-1.2.8}/src/masscube/feature_detection.py +0 -0
  14. {masscube-1.2.7 → masscube-1.2.8}/src/masscube/feature_evaluation.py +0 -0
  15. {masscube-1.2.7 → masscube-1.2.8}/src/masscube/feature_grouping.py +0 -0
  16. {masscube-1.2.7 → masscube-1.2.8}/src/masscube/mzpkl.py +0 -0
  17. {masscube-1.2.7 → masscube-1.2.8}/src/masscube/network.py +0 -0
  18. {masscube-1.2.7 → masscube-1.2.8}/src/masscube/normalization.py +0 -0
  19. {masscube-1.2.7 → masscube-1.2.8}/src/masscube/params.py +0 -0
  20. {masscube-1.2.7 → masscube-1.2.8}/src/masscube/raw_data_utils.py +0 -0
  21. {masscube-1.2.7 → masscube-1.2.8}/src/masscube/utils_functions.py +0 -0
  22. {masscube-1.2.7 → masscube-1.2.8}/src/masscube/visualization.py +0 -0
  23. {masscube-1.2.7 → masscube-1.2.8}/src/masscube.egg-info/SOURCES.txt +0 -0
  24. {masscube-1.2.7 → masscube-1.2.8}/src/masscube.egg-info/dependency_links.txt +0 -0
  25. {masscube-1.2.7 → masscube-1.2.8}/src/masscube.egg-info/entry_points.txt +0 -0
  26. {masscube-1.2.7 → masscube-1.2.8}/src/masscube.egg-info/requires.txt +0 -0
  27. {masscube-1.2.7 → masscube-1.2.8}/src/masscube.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: masscube
3
- Version: 1.2.7
3
+ Version: 1.2.8
4
4
  Summary: Accurate and fast data processing for metabolomics
5
5
  Author-email: Huaxu Yu <yhxchem@outlook.com>
6
6
  Maintainer-email: Huaxu Yu <yhxchem@outlook.com>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "masscube"
7
- version = "1.2.7"
7
+ version = "1.2.8"
8
8
  authors = [
9
9
  { name="Huaxu Yu", email="yhxchem@outlook.com" },
10
10
  ]
@@ -412,13 +412,16 @@ def output_feature_to_msp(feature_table, output_path):
412
412
  f.write("\n")
413
413
  continue
414
414
 
415
- if feature_table['annotation'][i] is None:
415
+ if feature_table['annotation'][i] is None or feature_table['annotation'][i] != feature_table['annotation'][i]:
416
416
  name = "Unknown"
417
417
  else:
418
418
  name = str(feature_table['annotation'][i])
419
419
 
420
420
  peaks = re.findall(r"\d+\.\d+", feature_table['MS2'][i])
421
- f.write("NAME: " + name + "\n")
421
+ try:
422
+ f.write("NAME: " + name + "\n")
423
+ except:
424
+ f.write("NAME: Unknown\n")
422
425
  f.write("PRECURSORMZ: " + str(feature_table['m/z'][i]) + "\n")
423
426
  f.write("PRECURSORTYPE: " + str(feature_table['adduct'][i]) + "\n")
424
427
  f.write("RETENTIONTIME: " + str(feature_table['RT'][i]) + "\n")
@@ -194,7 +194,7 @@ def umap_analysis(feature_table, params):
194
194
  df = df[(~df['is_qc']) & (~df['is_blank'])]
195
195
  n = df.iloc[:, 0].values
196
196
  data_arr = feature_table[n].values # samples in columns and features in rows
197
- keys = [i for i in df.columns[1:] if i not in ['is_qc', 'is_blank', 'analytical_order', 'time', 'ABSOLUTE_PATH', 'VALID']]
197
+ keys = [i for i in df.columns[1:] if i not in PROJECT_KEYS]
198
198
 
199
199
  # UMAP analysis
200
200
  data_arr = data_arr.T
@@ -270,3 +270,4 @@ def generate_random_color(num):
270
270
 
271
271
 
272
272
  COLORS = ["#FF5050", "#0078F0", "#00B050", "#FFC000", "#7030A0", "#FF00FF", "#00B0F0", "#FF0000", "#00FF00", "#0000FF"]
273
+ PROJECT_KEYS = ['is_qc', 'is_blank', 'analytical_order', 'time', 'ABSOLUTE_PATH', 'VALID', 'batch_id', 'SINGLE_FILE_PATH']
@@ -254,10 +254,10 @@ def untargeted_metabolomics_workflow(path=None, return_results=False, only_proce
254
254
  output_feature_table(feature_table, output_path)
255
255
  # output the acquired MS2 spectra to a MSP file (designed for MassWiki)
256
256
  output_path = os.path.join(params.project_file_dir, "features.msp")
257
+ output_feature_to_msp(feature_table, output_path)
257
258
  # output features as pickle file to the project directory
258
259
  with open(os.path.join(params.project_file_dir, "aligned_features.pkl"), "wb") as f:
259
260
  pickle.dump(features, f)
260
- output_feature_to_msp(feature_table, output_path)
261
261
  print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
262
262
  else:
263
263
  print("Step 3: Feature alignment is skipped. Using the existing aligned feature table.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: masscube
3
- Version: 1.2.7
3
+ Version: 1.2.8
4
4
  Summary: Accurate and fast data processing for metabolomics
5
5
  Author-email: Huaxu Yu <yhxchem@outlook.com>
6
6
  Maintainer-email: Huaxu Yu <yhxchem@outlook.com>
File without changes
File without changes
File without changes
File without changes