calibration {ptairMS} | R Documentation

## Calibrates the mass axis with references masses

### Description

To convert Time Of Flight (TOF) axis to mass axis, we use the formula: mz = ((tof-b)/a )^2 (Muller et al. 2013) To estimate those parameters, references peaks with accurate know masses and without overlapping peak are needed. The best is that the references masses covers a maximum of the mass range.

### Usage

    calibration(
      x,
      mzCalibRef = c(21.022, 29.013424, 41.03858, 60.0525, 203.943, 330.8495),
      calibrationPeriod = 60,
      tol = 70
    )

    ## S4 method for signature 'ptrRaw'
    calibration(
      x,
      mzCalibRef = c(21.022, 29.013424, 41.03858, 59.049141, 75.04406, 203.943, 330.8495),
      calibrationPeriod = 60,
      tol = 70
    )

    ## S4 method for signature 'ptrSet'
    calibration(
      x,
      mzCalibRef = c(21.022, 29.013424, 41.03858, 75.04406, 203.943, 330.8495),
      calibrationPeriod = 60,
      tol = 70
    )

### Arguments

`x` | a `ptrRaw-class` or `ptrSet-class` object
`mzCalibRef` | Vector of accurate mass values of intensive peaks and 'unique' in a nominal mass interval (without overlapping)
`calibrationPeriod` | in second, coefficient calibration are estimated for each sum spectrum of `calibrationPeriod` seconds
`tol` | the maximum error tolerated in ppm. If more than `tol` warnings.

### Value

the same ptrRaw or ptrSet as in input, with the following modified element:

- mz: the new mz axis calibrated

- rawM: same raw matrix with the new mz axis in rownames

- calibMassRef: reference masses used for the calibration

- calibMzToTof and calibTofToMz: function to convert TOF to mz

- calibError: the calibration error to the reference masses in ppm

- calibrationIndex: index time of each calibration period

### Examples

    ### ptrRaw object

    library(ptairData)
    filePath <- system.file('extdata/exhaledAir/ind1', 'ind1-1.h5',
    package = 'ptairData')
    raw <- readRaw(filePath, calib = FALSE)
    rawCalibrated <- calibration(raw)

[Package ptairMS version 1.0.1 Index]