Identify a homologous alkane series using diagnostic ions and interpolate their retention indices with a natural cubic spline. The coordinate uses peak onset plus half a local narrow-peak duration, reducing the influence of tailing.
Arguments
- standard
ANDI-MS CDF path, scan-by-mass matrix, or list with Y and time.
- time
Increasing scan times in minutes for matrix input.
- carbon
Permitted carbon numbers, default 7:40. The molecular ion must lie within the acquired mass range. Supply the known standard range when available.
- anchors
Optional data frame with carbon and retention_time columns, supplying verified calibration coordinates directly. An optional narrow_width column supplies local small-peak durations for timing sample profiles.
- control
Named calibration controls, described below.
- psf
Optional calibrated PSF from logconNMF::estimatePSF(), or a list with psf_kernels (one kernel per row), psf_offsets in minutes and psf_timepoints (or peak_timepoints) in minutes. Its local width at the chosen height fraction supplies the small-peak duration. A single kernel gives a constant duration. NULL estimates a narrow-width envelope from the detected standard peaks.
- object
A fitted RIcalibration.
- newdata
Retention coordinates in minutes.
- extrapolate
Use linear continuation outside the calibration range. FALSE returns NA outside the range.
- ...
Additional method arguments.
- x
An RIcalibration object.
Value
An RIcalibration object with accepted anchors, all candidate diagnostics, interpolation method, local narrow-peak widths and timing convention.
Details
For an alkane with c carbon atoms the nominal molecular ion is 14c+2. Its excess above the carbon-13 isotope contribution of the adjacent alkyl ion is used with the 43, 57, 71, 85, 99 and 113 fragment series. Local spectral backgrounds are measured outside the peak shoulders, so a broad alkane's molecular ion is retained in the corrected spectrum. Candidate anchors must have a coherent saturated-hydrocarbon spectrum. A maximum-weight increasing carbon-number sequence removes duplicate maxima and inconsistent assignments. Solvent-range C6 is excluded by default.
Peak onset and duration use a relative-height fraction of 0.01 by default. A supplied calibrated PSF gives its local small-peak duration; otherwise a local lower envelope of standard peak durations estimates that duration. Both standards and sample profiles use t_star = onset + narrow_width/2. A natural cubic spline interpolates the verified coordinates and indices 100c exactly, with zero second derivatives at the boundary anchors. If this curve would reverse direction, a monotone cubic interpolant through the same anchors is used. Extrapolation is disabled by default in predict(); when requested it uses the boundary slopes.
control accepts fraction, baseline_window (minutes), min_separation (minutes), min_relative, min_molecular_fraction, min_molecular_ratio, min_alkane_fraction and width_quantile. The returned anchor table includes the molecular-ion evidence and calibration residuals for inspection. Explicit anchors bypass automatic assignment and use their supplied timing.
References
National Institute of Standards and Technology. NIST Chemistry WebBook, gas chromatographic retention data. https://webbook.nist.gov/chemistry/gc-ri/.
van den Dool, H. and Kratz, P. D. (1963). A generalization of the retention index system including linear temperature programmed gas-liquid partition chromatography. Journal of Chromatography 11, 463–471. doi:10.1016/S0021-9673(01)80947-X .
Examples
a <- data.frame(carbon=8:15, retention_time=c(3,4,5.2,6.7,8.5,10.6,13,15.7))
cal <- calibrateRI(anchors=a)
predict(cal, c(5,10))
#> [1] 984.8493 1272.8362
cal
#> 8 alkane anchors; C8--C15; calibration RMSE 0 RI units
