Description Usage Arguments Details Value S3 METHODS See Also Examples
Computes the parameters of the quadratic equation used by Ciphergen mass spectrometers to convert time-of-flight to m/z values.
1 | msCalibrate(mz, tof, u=20000, FUN="lm", digits=4, predict.mz=TRUE)
|
mz |
A vector of mass-to-charge ( |
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 |
digits |
The maximum precision to use in calculating the |
predict.mz |
A logical. If |
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.
Get regression coefficients.
Plot the predicted m/z values versus supplied tof. Optional plot parameters are as follows:
The plot type. Default: "b".
A character string defining the abscissa label. Default: "tof".
A character string defining the ordinate label. Default: "m/z".
A logical value. If TRUE, the plot is added using the current
par() layout. Otherwise a new plot is produced. Default: FALSE.
Additional plot arguments, i.e., par() options.
Predict m/z values from from tof input.
The following optional arguments are supported:
New TOF values to predict over. If missing, the original
TOF values will be used. Default: NULL (missing).
The maximum precision to use in calculating the m/z values. Default: 4.
Print the results.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## 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"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.