rainbow provides programmatic access to the raw data encoded in chromatography and mass spectrometry binary files. This library supports the following vendors and detectors:
Agilent .D
.uv- UV spectrum (supports incomplete files).ch- UV, FID, CAD, and ELSD channels.ms- MS (supports incomplete files)MSProfile.bin- HRMS
Waters .raw
CHRO- CAD and ELSD, as well as miscellaneous analog dataFUNC- UV and MS
There is documentation for rainbow that also details the structure of each binary file format.
pip install rainbow-api
The easiest way to get started is to give rainbow a directory path. Assume that we have a directory mydata.D that contains a binary file DAD1.uv with UV data.
import rainbow as rb
datadir = rb.read("mydata.D")
datafile = datadir.get_file("DAD1A.uv")Here, the datadir DataDirectory object contains a DataFile object for DAD1A.uv.
The raw UV data is contained in numpy arrays that are attributes of datafile. Users may find the following particularly useful:
datafile.xlabels- 1D numpy array with retention timesdatafile.ylabels- 1D numpy array with wavelengthsdatafile.data- 2D numpy array with absorbances
There is a tutorial available. There are also example snippets for basic tasks. Or just check out the full API.
rainbow/contains the code of the Python library.docs/contains code for generating documentation. To build documentation locally, you will need to install thesphinxandsphinx-rtd-themepackages. Then, move to thedocs/directory and runmake html. The docpages will be generated underdocs/_build.tests/contains unit tests for the library. These can be run withpython -m unittest.