Parse 'Agilent' or 'Waters' files with rainbow parsers.
Usage
call_rainbow(
path,
format_in = c("agilent_d", "waters_raw", "masshunter", "chemstation", "chemstation_uv",
"chemstation_fid", "chemstation_ms"),
format_out = c("matrix", "data.frame", "data.table"),
data_format = c("wide", "long"),
by = c("detector", "name"),
what = NULL,
read_metadata = TRUE,
metadata_format = c("chromconverter", "raw"),
collapse = TRUE,
precision = 1,
sparse = TRUE,
bin_width = NULL
)Arguments
- path
Path to file.
- format_in
Format of the supplied files. Either
agilent_d,waters_raw,masshunter,chemstation,chemstation_uv,chemstation_fid, orchemstation_ms.- format_out
Class of output. Either
matrix,data.frame, ordata.table.- data_format
Whether to return data in
wide(default) orlongformat.- by
How to group the returned list: by
detector(default), or byname, one element per data file in the directory.- what
Which detectors to return (e.g.
MS,UV,CAD,ELSD). Applies only whenby = "detector". Defaults toNULL, which returns all of them.- read_metadata
Logical. Whether to attach metadata. Defaults to
TRUE.- metadata_format
Format to output metadata. Either
chromconverter(standardized field names) orraw(vendor field names, unmapped).- collapse
Logical. Whether to collapse lists that only contain a single element. Defaults to
TRUE.- precision
Number of decimals of the m/z grid, which is spaced
10^-precisionapart. Defaults to1. Ignored ifbin_widthis supplied.- sparse
Logical. Whether to drop zero intensities from MS data. Applies only to
longformat. Defaults toTRUE.- bin_width
Width of the m/z grid, in daltons. An alternative to
precisionfor grids that are not a power of ten (e.g.0.5). Defaults toNULL, in which case the grid is derived fromprecisionas10^-precision.
Value
A (nested) list of chromatograms, or a single chromatogram for the
chemstation formats, in the class given by format_out. The list is
grouped according to the value of by.
Details
Uses rainbow parsers to read in Agilent
(.D) and Waters (.raw) files. For agilent_d, waters_raw and
masshunter, path is the data directory (.D or .raw), and the result
is a list grouped according to by. For the chemstation formats, path
is a single file (e.g. .uv), the result is a single chromatogram, and by
and what are ignored. Otherwise, data can be filtered by detector type
using the what argument.
See also
Other external parsers:
call_entab(),
call_openchrom(),
read_thermoraw(),
sp_converter(),
uv_converter()
