Learn R Programming

chromConverter (version 0.12.0)

read_peaklist: Read peak lists

Description

Reads peak lists from specified folders or vector of paths.

Usage

read_peaklist(
  paths,
  find_files,
  format_in = c("chemstation", "shimadzu_fid", "shimadzu_dad", "shimadzu_lcd",
    "shimadzu_gcd", "chromatotec", "asm", "cdf", "openlab"),
  pattern = NULL,
  peaktable_format = c("chromatographr", "original"),
  metadata_format = c("chromconverter", "raw"),
  read_metadata = TRUE,
  progress_bar = TRUE,
  cl = 1,
  sort_by = c("auto", "none", "acquisition_time", "file_time"),
  data_format = NULL
)

Value

A peak_list: a list with one element per sample, holding its peak table, or a list of peak tables where the file records more than one. The tables are named by wavelength (e.g. "254") where the file records one, and otherwise by the file's own name for the signal; a table identical to another at the same wavelength is a copy and is left out. Each row is a peak. Every table starts with a sample column and a lambda column giving the signal's wavelength, which is NA for a detector without one or a file that does not record it, followed by the columns of peaktable_format.

Arguments

paths

Paths to files or folders containing peak list files.

find_files

Logical. Whether to treat the supplied paths as directories to search for files. Inferred if not supplied, by testing whether every path is a file.

format_in

Format of files to be imported/converted. One of chemstation (the default), shimadzu_fid, shimadzu_dad, shimadzu_lcd, shimadzu_gcd, chromatotec, asm, cdf (ANDI chrom) or openlab ('Agilent OpenLab CDS' .rx files, named by signal from the .acaml file beside them).

pattern

A pattern (e.g. a file extension). Defaults to NULL, in which case the file extension will be deduced from format_in.

peaktable_format

Whether to return peak tables in the standard chromatographr layout (the default) or with all the columns the file provides (original). A chromatographr table has the columns rt, start, end, area, height and FWHM (the full width at half maximum), with times in the same unit as the format's chromatograms and NA where the file does not record a value.

metadata_format

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

read_metadata

Logical. Whether to attach metadata. Defaults to TRUE.

progress_bar

Logical. Whether to show progress bar. Defaults to TRUE.

cl

Argument to pbapply specifying the number of parallel workers to use or a cluster object created by makeCluster (a set of parallel R worker processes). Defaults to 1.

sort_by

How to sort the samples: auto (default) sorts files by acquisition time unless paths lists the files explicitly or any acquisition time is missing; none keeps files in the order given, or in alphabetical order if find_files = TRUE; acquisition_time sorts by the acquisition time recorded in each file (run_datetime); file_time sorts by the time when each file was last modified.

data_format

Deprecated. Use peaktable_format instead.

Author

Ethan Bass

Examples

Run this code
path <- system.file("extdata", "benzoxazinoid_standards",
                    package = "chromConverter")
peak_list <- read_peaklist(path, progress_bar = FALSE)
names(peak_list)
peak_list[["BENZOS_250PPM"]][["254"]]

Run the code above in your browser using DataLab