Learn R Programming

enviPat (version 2.1)

isowrap: Combined (batch) calculation of isotope pattern, envelope and centroids/intensoids/valleys on interpolated resolutions.

Description

Wrapper combining the functions getR, isopattern, envelope and vdetect.

Uses chemical formulas from check_chemform as argument.

Usage

isowrap(isotopes, checked, resmass, resolution = FALSE, nknots = 6, spar = 0.2, threshold = 0.1, charge = 1, emass = 0.00054858, algo=2, ppm = FALSE, dmz = "get", frac = 1/4, env = "Gaussian", detect = "centroid", plotit = FALSE)

Arguments

isotopes
Dataframe listing all relevant isotopes, such as isotopes.
checked
Output dataframe from check_chemform with correct chemical formulas.
resmass
For resolution interpolation: dataframe with two columns, resolution and mass; see getR. Otherwise, set to FALSE and use argument resolution to utilize a single resolution.
resolution
Single resolution value. Only used if argument resmass is set to FALSE.
nknots
Number of knots, see getR. Ignored if argument resmass set to FALSE.
spar
Smoothing parameter, see getR. Ignored if argument resmass set to FALSE.
threshold
Abundance below which isotope peaks are omitted, see isopattern.
charge
z in m/z, see isopattern.
emass
Electrone mass. Only relevant if charge is not set to FALSE, see isopattern.
algo
Which algorithm to use? Type 1 or 2. See details section in isopattern.
ppm
Set stick discretization, see details section of envelope.
dmz
Set stick discretization, see details section of envelope.
frac
Set stick discretization, see details section of envelope.
env
Peak shape function, see envelope.
detect
Return either "centroid", "intensoid" or "valley". See vdetect.
plotit
Should results be plotted, TRUE/FALSE?

Value

List with length equal to length of list profiles, with equal names of list entries. Each entry in that list contains the centroids, intensoids or valley of the envelope in two columns:
m/z
m/z
abundance
area(centroid) or abundance (intensoid, valley)

See Also

vdetect

Examples

Run this code

data(isotopes);
data(resolution_list);
data(chemforms);
chemforms<-chemforms[1:10];

checked<-check_chemform(
    isotopes,
    chemforms
  );

resmass<-resolution_list[[1]]

centro<-isowrap(
  isotopes,
  checked,
  resmass=resolution_list[[4]],
  resolution=FALSE,
  nknots=4,
  spar=0.2,
  threshold=0.1,
  charge=1,
  emass=0.00054858,
  algo=2,
  ppm=FALSE,
  dmz="get",   # retrieve dm from R=m/dm
  frac=1/4,
  env="Gaussian",
  detect="centroid",
  plotit=TRUE
)


Run the code above in your browser using DataLab