\HeaderA{calibrate-methods}{Calibrate peaks for correcting unprecise m/z values}{calibrate.Rdash.methods}
\aliasA{calibrate}{calibrate-methods}{calibrate}
\aliasA{calibrate,xcmsSet-method}{calibrate-methods}{calibrate,xcmsSet.Rdash.method}
\keyword{methods}{calibrate-methods}
\keyword{file}{calibrate-methods}
\begin{Description}\relax
Calibrate peaks of a xcmsSet via a set of known masses
\end{Description}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] a \code{xcmsSet} object with uncalibrated mz
\item[\code{wishlist}] a vector or a list of vectors with reference m/z-values
\item[\code{method}] the used calibrating-method, see below
\item[\code{mzppm}] the relative error used for matching peaks in ppm (parts per million)
\item[\code{mzabs}] the absolute error used for matching peaks in Da
\item[\code{neighbours}] the number of neighbours from wich the one with the highest intensity is used (instead of the nearest)
\item[\code{plotres}] can be set to TRUE if wanted a result-plot showing the found m/z with the distances and the regression
\end{ldescription}
\end{Arguments}
\begin{Value}
\begin{ldescription}
\item[\code{object}] a \code{xcmsSet} with one ore more samples
\item[\code{wishlist}] for each sample can be used a different wishlist if there is given a list of m/z-vectors. the length of the list must be the same as the number of samples, alternatively a single vector of masses can be given which is used for all samples.
\item[\code{method}] "shift" for shifting each m/z, "linear" does a linear regression and adds a linear term to each m/z. "edgeshift" does a linear regression within the range of the mz-wishlist and a shift outside.
\end{ldescription}
\end{Value}
\begin{Section}{Methods}
\describe{
\item[object = "xcmsSet"] \code{
    calibrate(object, wishlist,method="linear",
    mzabs=0.0001, mzppm=5,
    neighbours=3, plotres=FALSE)
  }

}
\end{Section}
\begin{SeeAlso}\relax
\code{\LinkA{xcmsSet-class}{xcmsSet.Rdash.class}},
\end{SeeAlso}

