rainbow.datafile.DataFile
- class DataFile(path, detector, xlabels, ylabels, data, metadata)[source]
Bases:
objectClass representing a chromatogram data file.
- Parameters:
path (str) – Path of the file.
detector (str) – Detector for the file.
xlabels (numpy.ndarray) – 1D array with retention times (in minutes).
ylabels (numpy.ndarray) – 1D array with y-axis labels (e.g. mz, wavelength).
data (numpy.ndarray) – 2D array with data values (e.g. intensity).
metadata (dict) – Metadata for the file.
- Attributes:
name (str) – Name of the file.
detector (str) – Name of the detector. Options: UV, MS, FID, CAD, ELSD.
xlabels (numpy.ndarray) – 1D array with retention times (in minutes).
ylabels (numpy.ndarray) – 1D array with y-axis labels (e.g. mz, wavelength).
data (numpy.ndarray) – 2D array with data values (e.g. intensity). The rows correspond to the retention times and the columns correspond to the y-axis labels.
metadata (dict) – Depends on the vendor and file format.
- extract_traces(labels=None)[source]
Extracts data corresponding to the specified
labels.Raises an exception if any
labelsare invalid.- Parameters:
labels (int/float/list, optional) – Ylabel(s) to extract.
- Returns:
2D numpy array containing data for the specified ylabel(s). The rows correspond to the ylabels and the columns corrrespond to the retention times.
- export_csv(filename, labels=None, delim=',')[source]
Outputs a CSV containing data for the specified
labels.- Parameters:
filename (str) – Filename for the output CSV.
labels (int/float/list, optional) – Ylabel(s) to export.
delim (str, optional) – Delimiter used in the output CSV.