rainbow-api 1.0.7__tar.gz → 1.0.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 (22) hide show
  1. {rainbow_api-1.0.7/rainbow_api.egg-info → rainbow_api-1.0.8}/PKG-INFO +1 -1
  2. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/pyproject.toml +1 -1
  3. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/rainbow/agilent/chemstation.py +1 -1
  4. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/rainbow/waters/masslynx.py +25 -0
  5. {rainbow_api-1.0.7 → rainbow_api-1.0.8/rainbow_api.egg-info}/PKG-INFO +1 -1
  6. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/COPYING +0 -0
  7. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/README.md +0 -0
  8. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/rainbow/__init__.py +0 -0
  9. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/rainbow/agilent/__init__.py +0 -0
  10. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/rainbow/agilent/masshunter.py +0 -0
  11. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/rainbow/datadirectory.py +0 -0
  12. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/rainbow/datafile.py +0 -0
  13. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/rainbow/waters/__init__.py +0 -0
  14. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/rainbow_api.egg-info/SOURCES.txt +0 -0
  15. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/rainbow_api.egg-info/dependency_links.txt +0 -0
  16. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/rainbow_api.egg-info/requires.txt +0 -0
  17. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/rainbow_api.egg-info/top_level.txt +0 -0
  18. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/setup.cfg +0 -0
  19. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/tests/test_agilent.py +0 -0
  20. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/tests/test_datadirectory.py +0 -0
  21. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/tests/test_datafile.py +0 -0
  22. {rainbow_api-1.0.7 → rainbow_api-1.0.8}/tests/test_waters.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rainbow-api
3
- Version: 1.0.7
3
+ Version: 1.0.8
4
4
  Summary: Read chromatography and mass spectrometry binary files
5
5
  Author: Evan Shi and Eugene Kwan
6
6
  Author-email: evanyshi@cmu.edu
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "rainbow-api"
7
- version = "1.0.7"
7
+ version = "1.0.8"
8
8
  description = "Read chromatography and mass spectrometry binary files"
9
9
  readme = "README.md"
10
10
  license = {text = "COPYING"}
@@ -605,7 +605,7 @@ def parse_ms(path, prec=0):
605
605
  num_times = int_unpack(f.read(4))[0]
606
606
  else:
607
607
  f.seek(data_offsets['gc_num_times'])
608
- num_times = struct.unpack('<I', f.read(4))[0]
608
+ num_times = struct.unpack('<H', f.read(2))[0]
609
609
 
610
610
  # Go to the data start offset.
611
611
  f.seek(data_offsets['data_start'])
@@ -6,6 +6,7 @@ import os
6
6
  import re
7
7
  import numpy as np
8
8
  from rainbow.datafile import DataFile
9
+ import pandas as pd
9
10
 
10
11
  """
11
12
  SPECTRUM PARSING METHODS
@@ -664,3 +665,27 @@ def parse_metadata(path):
664
665
  if not value.isspace():
665
666
  metadata['vialpos'] = value
666
667
  return metadata
668
+
669
+
670
+
671
+ def parse_compound_names(path):
672
+ with open(os.path.join(path, "_FUNC001.CMP"), "rb") as f:
673
+ data = f.read().decode("ascii", "ignore")
674
+ data = data[7:]
675
+ data = data.split("\x00")
676
+ data = list(filter(lambda x: x != "", data))
677
+ # loop through the da{}ta and remove the byte sequences x18
678
+ data = [re.sub(r'\x18', '', x) for x in data]
679
+ data
680
+
681
+ compounds = []
682
+ transition = []
683
+ for i in range(0, len(data), 3):
684
+ compounds.append(data[i])
685
+ transition.append(data[i+1])
686
+ df = pd.DataFrame({"compounds": compounds, "transition": transition})
687
+
688
+ df["index"] = [i for i in range(1, len(transition)+1)]
689
+ df["measurments"] = df["compounds"] + df["index"].astype(str)
690
+
691
+ return df
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rainbow-api
3
- Version: 1.0.7
3
+ Version: 1.0.8
4
4
  Summary: Read chromatography and mass spectrometry binary files
5
5
  Author: Evan Shi and Eugene Kwan
6
6
  Author-email: evanyshi@cmu.edu
File without changes
File without changes
File without changes