Skip to contents

Uses rainbow parsers to read in Agilent (.D) and Waters (.raw) files. If format_in is "agilent_d" or "waters_raw", a directory of the appropriate format (.D or .raw) should be provided to the path argument. If format_in is "chemstation_uv" a .uv file should be provided. Data can be filtered by detector type using the what argument.

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, or chemstation.

format_out

Class of output. Either matrix, data.frame, or data.table.

data_format

Whether to return data in wide (default) or long format.

by

How to order the list that is returned. Either detector (default) or name.

what

What types of data to return (e.g. MS, UV, CAD, ELSD). This argument only applies if by == "detector".

read_metadata

Logical. Whether to attach metadata. Defaults to TRUE.

metadata_format

Format to output metadata. Either chromconverter (standardized field names) or raw (vendor field names, unmapped).

collapse

Logical. Whether to collapse lists that only contain a single element. Defaults to TRUE.

precision

Number of decimals to round mz values. Defaults to 1. Ignored if bin_width is supplied.

sparse

Logical. Whether to return MS data in sparse format (excluding zeros). Defaults to TRUE. Applies only when data are requested in long format.

bin_width

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.

Value

Returns a (nested) list of matrices or data.frames according to the value of format_out. Data is ordered according to the value of by.

Author

Ethan Bass

Examples

if (FALSE) { # \dontrun{
call_rainbow("path/to/file.D", format_in = "agilent_d")
} # }