peakPantheR_quickEIC: Extract and plot a EIC from a raw data file

View source: R/peakPantheR_quickEIC.R

peakPantheR_quickEICR Documentation

Extract and plot a EIC from a raw data file

Description

Simple plot of an Extracted Ion Chromatogram (EIC) from a raw data file and a provided mz and rt window. Return ggplot plot object.

Usage

peakPantheR_quickEIC(
    spectraPath,
    rt,
    mz,
    valuesOnly = "Plot",
    centroided = TRUE,
    msLevel = 1L,
    verbose = TRUE
)

Arguments

spectraPath

(str) Path to the raw data file to read (uses 'MSnbase::readMSData()')

rt

(numeric(2) or two-column matrix) the lower and upper retention time range from which the data should be extracted. If a matrix is passed, each row corresponds to a different window. If not provided, the full retention time range will be extracted.

mz

(numeric(2) or two-column matrix) the lower and upper mass range from which the data should be extracted. If a matrix is passed, each row corresponds to a different window. If not provided, the full mass range will be extracted.

valuesOnly

(str) If 'Raw' only load the file and return a table of raw extracted values (exported version of 'extractSignalRawData()'). If 'EIC' return a table of EIC data point. Else return the EIC plot (default).

centroided

(bool) Indicate to 'MSnbase::readMSData()' whether the spectra file is centroided or not (default to 'TRUE').

msLevel

(int) The MS level at which the data should be extracted (default to MS level 1).

verbose

(bool) Output proress information or not.

Value

Grob (ggplot object) of the EIC plot, if ‘valuesOnly=’Raw'' returns a data.frame of raw datapoints with as columns 'rt', 'mz' and 'int'. If ‘valuesOnly=’EIC'' returns a data.frame of EIC datapoints with as columns 'rt' and 'int'.

Examples

## Use a file form the faahKO package and plot an EIC of interest
library(faahKO)
spectraPath <- system.file('cdf/KO/ko15.CDF',package='faahKO')
peakPantheR_quickEIC(spectraPath,
                        rt = c(3290., 3410.),
                        mz = c(522.194778, 522.205222))

phenomecentre/peakPantheR documentation built on Feb. 29, 2024, 9:07 p.m.