Parse 'Agilent' or 'Waters' files with rainbow parsers.
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,
centroid = FALSE,
hrms = FALSE
)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.
Path to file.
Format of the supplied files. Either agilent_d,
waters_raw, masshunter, chemstation, chemstation_uv,
chemstation_fid, or chemstation_ms.
Class of output. Either matrix, data.frame, or
data.table.
Whether to return data in wide (default) or long format.
How to group the returned list: by detector (default), or by
name, one element per data file in the directory.
Which detectors to return (e.g. MS, UV, CAD, ELSD).
Applies only when by = "detector". Defaults to NULL, which returns all
of them.
Logical. Whether to attach metadata. Defaults to TRUE.
Format to output metadata. Either chromconverter
(standardized field names) or raw (vendor field names, unmapped).
Logical. Whether to collapse lists that only contain a single
element. Defaults to TRUE.
Number of decimals of the m/z grid, which is spaced
10^-precision apart. Defaults to 1. Ignored if bin_width is supplied.
Logical. Whether to drop zero intensities from MS data.
Applies only to long format. Defaults to TRUE.
Width of the m/z grid, in daltons. An alternative to
precision for grids that are not a power of ten (e.g. 0.5). Defaults to
NULL, in which case the grid is derived from precision as
10^-precision.
Logical. Whether to read the centroided (MSPeak.bin)
and/or profile (MSProfile.bin) mass spectra of an 'Agilent MassHunter'
.d directory. Both default to FALSE, as in 'rainbow', so no mass spectra
are read unless one is TRUE. Like other mass spectra, they are binned onto
the m/z grid set by precision or bin_width, which coarsens
high-resolution data. Ignored for the chemstation formats.
Ethan Bass
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.
Other external parsers:
call_entab(),
call_openchrom(),
read_thermoraw(),
sp_converter(),
uv_converter()
if (FALSE) {
call_rainbow("path/to/file.D", format_in = "agilent_d")
}
Run the code above in your browser using DataLab