Mass spectrometry: systematic mathematic transformation for calibration

Given a NaI mass calibration in the m/z 300-2000 range on a QTOF instrument as shown below:

and given any uncalibrated mass spectrum that has been measured with the same instrument settings. What is a general mathematical transformation that calibrates the mass spectrum to the NaI calibration. masses of the NaI clusters are of course known, i.e.

Overall, it seems the masses always deviate by about 0.1 m/z by being always a little bit too high than the reference in this case.

My question now is, how a simple mathematical approach could look like to calibrate mass spectra using the NaI reference. The simplest approach would be to just create a peak list out of the NaI spectrum, i.e. 472.8, 622.7, 772.6, ..., 1971.7 and perform a linear fit against the calculated NaI masses, i.e. 472.7, 622.6, 772.5, ..., 1971.6.

Which looks like this:

Where the slope of the line is 1.00003175282 and the intercept is -0.153462368663.

Because the overall mass range is high, while the variations in mass are of course small, this gives the ridiculously high $R^2$ of 0.999999999556.

Now I could just apply this linear function

f(m/z) = m/z * slope + intercept

to uncalibrated mass spectra. Is this simple approach viable? Because it does not take into account that the mass deviation might be different depending on the m/z region. From your experience, is it likely for a QTOF-instrument to show significantly different mass deviations in different mass regions? Would it be better to make a "polygonal chain" and divide the overall mass range in separate regions instead?

• You already have a tremendously good fit to your data. Try using chi squared instead of $R^2$ (which is useless btw) as then you can work out probability a good fit, see Bevington 'Data reduction and error analysis for the physical science' or Press, Teukolsky, Vetterling and Flannery; 'Numerical Recipes'. You can only really know how TOFms works outside the calibration region by experiment. Otherwise you can only hope that the response is linear. – porphyrin Jun 14 '17 at 15:51
• Thanks for the quick reply. 'You can only know how TOFms works outside the calibration region' I just want to add that I don't intent to measure outside the calibration region (i.e. no extrapolation, only interpolation). Thanks for the references, I will have a look : ) – logical x 2 Jun 14 '17 at 16:42
• Basically, I am unsure if the normal instrument calibration on a QTOF device is just a rescaling of the m/z scale or if it also includes some other internal adjustments. Because the typical calibration procedure are very tedious and if they are basically just a linear transformation on the m/z scale, Id rather just apply this change during postprocessing ... – logical x 2 Jun 14 '17 at 18:00
• The Waters calibration procedure (for Waters Q-TOF) is a polynomial fit (to the fourth or fifth order, I would need to check). The linear fit is quite good, as you show, but if you intend to really measure with ppm accuracy, you might need a better fit of the calibration curve. You should try to plot the residuals (difference between calibrated mass and reference points as a function of m/z) to see if there appears to be a systematic deviation from the linear fit on one edge or the other. – PLD Jun 14 '17 at 20:34
• @PLD That's a good idea. I will just try it out and see if I get a good calibration like this and I will plot the difference between calibrated mass and reference points as a function of m/z then. – logical x 2 Jun 15 '17 at 6:37