\HeaderA{findPeaks.centWave-methods}{Feature detection for high resolution LC/MS data}{findPeaks.centWave.Rdash.methods}
\aliasA{findPeaks.centWave}{findPeaks.centWave-methods}{findPeaks.centWave}
\aliasA{findPeaks.centWave,xcmsRaw-method}{findPeaks.centWave-methods}{findPeaks.centWave,xcmsRaw.Rdash.method}
\keyword{methods}{findPeaks.centWave-methods}
\begin{Description}\relax
Peak density and wavelet based feature detection for high resolution LC/MS data in centroid mode
\end{Description}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] \code{xcmsSet} object
\item[\code{ppm}] maxmial tolerated m/z deviation in consecutive scans, in ppm (parts per million)
\item[\code{peakwidth}] Chromatographic peak width, given as range (min,max) in seconds
\item[\code{snthresh}] signal to noise ratio cutoff, definition see below.
\item[\code{prefilter}] \code{prefilter=c(k,I)}. Prefilter step for the first phase. Mass traces are only retained if they contain at least \code{k} peaks with intensity \textgreater{}= \code{I}.
\item[\code{integrate}] Integration method. If \code{=1} peak limits are found through descent on the mexican hat filtered data, if \code{=2} the descent is done on the real data. Method 2 is very accurate but prone to noise, while method 1 is more robust to noise but less exact.

\item[\code{mzdiff}] minimum difference in m/z for peaks with overlapping retention
times, can be negative to allow overlap

\item[\code{fitgauss}] logical, if TRUE a Gaussian is fitted to each peak

\item[\code{scanrange}] scan range to process
\item[\code{noise}] optional argument which is useful for data that was centroided without any intensity threshold,
centroids with intensity \textless{} \code{noise} are omitted from ROI detection
\item[\code{sleep}] number of seconds to pause between plotting peak finding cycles

\item[\code{verbose.columns}] logical, if TRUE additional peak meta data columns are returned 

\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This algorithm is most suitable for high resolution LC/\{TOF,OrbiTrap,FTICR\}-MS data in centroid mode. In the first phase of the method mass traces (characterised as regions with less than \code{ppm} m/z deviation in consecutive scans) in the LC/MS map are located.
In the second phase these mass traces are further analysed. 
Continuous wavelet transform (CWT) is used to locate chromatographic peaks on different scales.
\end{Details}
\begin{Value}
A matrix with columns:

\begin{ldescription}
\item[\code{mz}] weighted (by intensity) mean of peak m/z across scans

\item[\code{mzmin}] m/z peak minimum

\item[\code{mzmax}] m/z peak maximum 

\item[\code{rt}] retention time of peak midpoint

\item[\code{rtmin}] leading edge of peak retention time

\item[\code{rtmax}] trailing edge of peak retention time

\item[\code{into}] integrated peak intensity

\item[\code{intb}] baseline corrected integrated peak intensity

\item[\code{maxo}] maximum peak intensity 

\item[\code{sn}] Signal/Noise ratio, defined as \code{(maxo - baseline)/sd}, where \\
\code{maxo} is the maximum peak intensity, \\
\code{baseline} the estimated baseline value and \\
\code{sd} the standard deviation of local chromatographic noise.

\item[\code{egauss}] RMSE of Gaussian fit
\item[\code{}] if \code{verbose.columns} is \code{TRUE} additionally :

\item[\code{mu}] Gaussian parameter mu
\item[\code{sigma}] Gaussian parameter sigma
\item[\code{h}] Gaussian parameter h
\item[\code{f}] Region number of m/z ROI where the peak was localised
\item[\code{dppm}] m/z deviation of mass trace across scans in ppm
\item[\code{scale}] Scale on which the peak was localised
\item[\code{scpos}] Peak position found by wavelet analysis
\item[\code{scmin}] Left peak limit found by wavelet analysis (scan number)
\item[\code{scmax}] Right peak limit found by wavelet analysis (scan number)
\end{ldescription}
\end{Value}
\begin{Section}{Methods}
\describe{
\item[object = "xcmsRaw"] \code{
    findPeaks.centWave(object, ppm=25, peakwidth=c(20,50), snthresh=10,
    prefilter=c(3,100), integrate=1, mzdiff=-0.001, fitgauss=FALSE,
    scanrange= numeric(), noise=0, sleep=0, verbose.columns=FALSE)
  }

}
\end{Section}
\begin{Author}\relax
Ralf Tautenhahn, \email{rtautenh@ipb-halle.de}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{findPeaks-methods}{findPeaks.Rdash.methods}}
\code{\LinkA{xcmsRaw-class}{xcmsRaw.Rdash.class}}
\end{SeeAlso}

