## <-------------- direct use of the error function -------------- >
## load the Synapt-QTOF error function
data(errf)
## predict the mass error in ppm
newdata <- data.frame(M = c(105, 131, 157), logI = c(1, .5, 1.4))
predict(errf, newdata) ## mass error in ppm
## <-------------- create a dummy error function -------------- >
## dataset to evaluate it:
## "M" is the mz,
## "logI" is the log of the intensity
## "err" is the mass error in ppm. The error is the difference between the
## actual m/z of a known ion, and the one measured with the spectrometer
MErr.data <- data.frame("M" = seq(1,500,2),
"logI" = rnorm(250, mean = 5, sd = 1),
"err" = rnorm(250, mean = 40, sd = 5))
## create the linear model
dummy.model <- lm(err~M+logI, data = MErr.data)
## Not run:
# ## <-------------- Use this for the annotation -------------- >
# ## load the example xcmsSet
# data(LCresults)
# data(FEMsettings)
#
# ## Run the analysis with an adaptive mass tolerance
# result.adaptive.dummy <- runLC(xset = LCresults$xset,
# settings = Synapt.RP,
# DB = LCDBtest$DB,
# errf = dummy.model)
#
# ## <----------- Use the Synapt Q-TOF error function ----------- >
# ## load the Synapt-QTOF error function
# data(errf)
#
# result.adaptive <- runLC(xset = LCresults$xset,
# settings = Synapt.RP,
# DB = LCDBtest$DB,
# errf = errf)
# ## End(Not run)
Run the code above in your browser using DataLab