| msCalibrate {msProcess} | R Documentation |
Computes the parameters of the quadratic equation used by Ciphergen mass spectrometers to convert time-of-flight to m/z values.
msCalibrate(mz, tof, u=20000, FUN="lm", digits=4, predict.mz=TRUE)
mz |
A vector of mass-to-charge (m/z) values (in daltons) of the calibrants used.
This input may also be a list or named vector whose objects have
(at the very least) the names "u", "t0", "a", and "b",
each containing a numeric scalar coresponding to the conversion coefficients.
In this case, the predict method is called to return the predicted
m/z values for the tof input. |
tof |
A numeric vector of corresponding time-of-flight measures (in nanoseconds) of the calibrants used. |
FUN |
A character string specifying the method for quadratic fitting.
Possible choices are "lm", "lmRobMM", "ltsreg",
"lmsreg", "l1fit", "rreg". Default: "lm". |
digits |
The maximum precision to use in calculating the m/z values. Default: 4. |
predict.mz |
A logical. If TRUE, predicts the mz from the input tof. Default: TRUE. |
u |
A numeric value denoting the voltage (in volts) used. Default: 20000. |
Assuming that the mass spectrometry data was recorded by a mass spectrometer
using time of flight (TOF) to register the number of ions
at each mass/charge (m/z) value,
mass calibration means to convert a raw TOF t to m/z.
The m/z ratio is usually a direct measure of mass because
the protein molecules are almost exclusively singly charged,
i.e., z=+1.
Typically, the calibration process involves acquiring a spectrum
from a standard sample with at least five proteins or peptides
of various molecular weights, spanning the mass range of interest.
A quadratic equation relating t to mz is then
fit to the t values of the standard peaks in this spectrum:
mz/U = a(t-t0)^2 + b,
where U is the preset voltage. The equation (with the fitted a, b,
and t0 coefficients) is then used to convert t to m/z
in mass spectra that are collected under the
same instrument conditions such as laser intensity, approximate
date, and focusing mass or time lag.
An object of class msCalibrate.
"b"."tof"."m/z".TRUE, the plot is added using the current
par() layout. Otherwise a new plot is produced. Default: FALSE.par() options.tof input.
The following optional arguments are supported:
NULL (missing).m/z values. Default: 4.
lm, lmRobMM, ltsreg, lmsreg, l1fit, rreg, msCalibrate.
## set up parameters
u <- 20000
t0 <- 0.0038
a <- 0.0002721697
b <- 0.0
## simulate m/z and time-of-flight
tof <- seq(from=20, to=60, length=7)
mz <- u*(a*(tof - t0)^2 + b)
## perform quadratic fitting
fit <- msCalibrate(mz=mz, tof=tof, u=u, FUN="lm")
## check the fitted parameters
print(fit)
## do prediction: convert tof to mass
tof2 <- seq(from=min(tof), to=max(tof), length=60)
mz.predicted <- predict(fit, tof2)
## visualization
plot(fit, type="p", col=1, xlim=range(tof2),
ylim=range(mz.predicted))
lines(tof2, mz.predicted, col=2)
legend(x=20, y=20000, col=1:2, pch="o ", lty=c(0,1),
legend=c("true", "predicted"))