Last data update: 2014.03.03

R: Post-experimental recalibration of observed mass to charge...
recalibrateR Documentation

Post-experimental recalibration of observed mass to charge ratios

Description

Mass spectrometry measurements like any other real-worls measurements are prone to systematic errors. Typically they are minimized by instrument calibration prior the analysis. Nonetheless, the calibration may drift over time or be affected by some adverse factors (temperature or space charge fluctuations).

This function estimates and removes the systematic error from the datasets. The side effect is the recalibrated experimentalMassToCharge values.

Usage

    recalibrate(object)

Arguments

object

An instance of class "MSnID".

Details

Currently it employs a very simple method of zero-centering the histogram of mass measurement errors. In the future it will contain more sophisticated recalibration routines.

Value

"MSnID" class instance with updated experimentalMassToCharge.

Author(s)

Vladislav A Petyuk vladislav.petyuk@pnnl.gov

See Also

MSnID mass_measurement_error correct_peak_selection

Examples

data(c_elegans)

# first let's fix the error of picking wrong monoisotopic peak
# otherwise the mass error range will be very large
msnidObj <- correct_peak_selection(msnidObj)

# original mass error in ppm
ppm <- mass_measurement_error(msnidObj)
hist(ppm, 200, xlim=c(-20,+20))

# The dataset is well calibrated. So let's introduce 
# some mass measurement error.
msnidObj$experimentalMassToCharge <- 
    msnidObj$experimentalMassToCharge * (1+0.00001)

# mass error (in ppm) after artificial de-calibration
ppm <- mass_measurement_error(msnidObj)
hist(ppm, 200, xlim=c(-20,+20))

# recalibration
msnidObj <- recalibrate(msnidObj)
ppm <- mass_measurement_error(msnidObj)
hist(ppm, 200, xlim=c(-20,+20))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(MSnID)
Loading required package: Rcpp
Warning messages:
1: replacing previous import 'reshape2::melt' by 'data.table::melt' when loading 'MSnID' 
2: replacing previous import 'reshape2::dcast' by 'data.table::dcast' when loading 'MSnID' 
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/MSnID/recalibrate.Rd_%03d_medium.png", width=480, height=480)
> ### Name: recalibrate
> ### Title: Post-experimental recalibration of observed mass to charge
> ###   ratios
> ### Aliases: recalibrate
> 
> ### ** Examples
> 
> data(c_elegans)
> 
> # first let's fix the error of picking wrong monoisotopic peak
> # otherwise the mass error range will be very large
> msnidObj <- correct_peak_selection(msnidObj)
> 
> # original mass error in ppm
> ppm <- mass_measurement_error(msnidObj)
> hist(ppm, 200, xlim=c(-20,+20))
> 
> # The dataset is well calibrated. So let's introduce 
> # some mass measurement error.
> msnidObj$experimentalMassToCharge <- 
+     msnidObj$experimentalMassToCharge * (1+0.00001)
> 
> # mass error (in ppm) after artificial de-calibration
> ppm <- mass_measurement_error(msnidObj)
> hist(ppm, 200, xlim=c(-20,+20))
> 
> # recalibration
> msnidObj <- recalibrate(msnidObj)
> ppm <- mass_measurement_error(msnidObj)
> hist(ppm, 200, xlim=c(-20,+20))
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>