fitIonInit | R Documentation |
nls
Fitting Using IonsfitIonInit
creates the formula and starting values for fitting mass
spectra using nls
based on molecular formulae. The
isotopic signatures are generated using isopattern
.
fitIonInit( ions, sd = 0.5, rel = NULL, peak = "gaussian", mass.shift = 0, noise = 0, tau = 0.1, charge = NULL, threshold = 10 )
ions |
Character. A character vector of molecular formulae sutable to be
passed to |
sd |
Numeric. The estimated standard deviation (or equivalent for
|
rel |
Numeric. A numeric vector of relative heights for each ion to initialize the starting values of the peak magnitudes. |
peak |
Character. A string specifying what sort of peak shape to fit.
Acceptable values are |
mass.shift |
Numeric. The estimated mass shift of the measured mass spectrum relative to the absolute mass position of the ions. |
noise |
Numeric. The estimated value of the constant noise floor of the mass spectrum. |
tau |
Numeric. The estimated value of the skewness parameter for
|
charge |
Integer. The charge(s) of the ion(s). Either a single value for
all ions or a vector of values of the same length as |
threshold |
Numeric. The lowest relative |
The fitting peak shape is either a gaussian (peak = "gaussian"
) or
exponentially modified gaussian (peak = "emg"
). The "gaussian"
peak
shape is defined as
rel[i] * λ[ij] * exp(-(mass - m[ij] - mass.shift)^2 / (2 * sd ^2))
where λ[ij] is the intensity of the jth isotope of ions[i]
normalized to the most intense isotope of ions[i]
and m[ij] is the
mass of the jth isotope of ions[i]
. The "emg"
peak shape
is defined as
(rel[i] * λ[ij] * sd / tau) * sqrt(pi/2) * exp(1/2*(sd/tau)^2-(mass-m[j]-mass.shift)/tau) * erfc(sqrt(1/2)*(sd/tau-(mass-m[j]-mass.shift)/sd))
A list containing elements of the fitting formula, the starting fit values, and the lower limits for each parameter.
nls
, isopattern
Other spectral fitting functions:
ionFormula()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.