Learn R Programming

nontarget (version 1.9)

plotdiff: Filtering important m/z differences among peaks of a HRMS data set.

Description

Produce a vector and histogram of m/z differences among peaks in a HRMS data set. Frequent m/z differences may be relatable to isotope patterns and the presence of different adducts.

Usage

plotdiff(peaklist, histbreaks = 10000, rttol = c(0, 0), mztol = c(0, 100), plotit = TRUE)

Arguments

peaklist
Dataframe of HRMS peaks with three numeric columns for (a) m/z, (b) intensity and (c) retention time, such as peaklist.
histbreaks
Number of histogram breaks.
rttol
Window (upper and lower difference bound, relative to the one peak) of retentiom time (RT) differences of peaks to the one peak screened from, see details and note. Units as given in column 3 of peaklist argument, e.g. [min].
mztol
Window (upper and lower difference bound, relative to the one peak) of m/z differences [u] of peaks to the one peak screened from, see details.
plotit
Should histogram be plotted? If FALSE, plotdiff will only return a vector of type diff, see value.

Value

Vector diffs of m/z differences. Can serve as input to deter.iso.

Details

For each one peak in the dataset, plotdiff screens for other peaks within arguments rttol and mztol, saves their m/z difference to the m/z value of the one peak and, over all one peaks, finally generates a histogram of all these m/z differences. Thus, and depending on the resolution set by argument histbreaks, frequent m/z differences can be visualized.

See Also

peaklist

Examples

Run this code

data(peaklist)
diffs<-plotdiff(peaklist, histbreaks = 10000, rttol = c(0, 0), mztol = c(0, 100), plotit = TRUE)

Run the code above in your browser using DataLab