msCalibrate: Constructor Function for Objects of Class msCalibrate

Description Usage Arguments Details Value S3 METHODS See Also Examples

Description

Computes the parameters of the quadratic equation used by Ciphergen mass spectrometers to convert time-of-flight to m/z values.

Usage

1
msCalibrate(mz, tof, u=20000, FUN="lm", digits=4, predict.mz=TRUE)

Arguments

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.

Details

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.

Value

An object of class msCalibrate.

S3 METHODS

coef

Get regression coefficients.

plot

Plot the predicted m/z values versus supplied tof. Optional plot parameters are as follows:

type

The plot type. Default: "b".

xlab

A character string defining the abscissa label. Default: "tof".

ylab

A character string defining the ordinate label. Default: "m/z".

add

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

Predict m/z values from from tof input. The following optional arguments are supported:

newtof

New TOF values to predict over. If missing, the original TOF values will be used. Default: NULL (missing).

digits

The maximum precision to use in calculating the m/z values. Default: 4.

print

Print the results.

See Also

lm, msCalibrate.

Examples

 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"))

zeehio/msProcess documentation built on May 4, 2019, 10:15 p.m.