\HeaderA{plotPeak}{Plot the identified peaks over the spectrum}{plotPeak}
\keyword{hplot}{plotPeak}
\begin{Description}\relax
Plot the identified peaks over the spectrum. The identified peaks are returned by \code{\LinkA{peakDetectionCWT}{peakDetectionCWT}} or \code{\LinkA{identifyMajorPeaks}{identifyMajorPeaks}}
\end{Description}
\begin{Usage}
\begin{verbatim}
plotPeak(ms, peakIndex = NULL, mz = 1:length(ms), range = c(min(mz), max(mz)), method = c("p", "l"), main = NULL, log = "", ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{ms}] the MS spectrum 
\item[\code{peakIndex}] m/z indexes of the identified peaks 
\item[\code{mz}] m/z value correspond to m/z index 
\item[\code{range}] the plot range of m/z value
\item[\code{method}] plot method of the identified peaks. method 'p' plot circles on the peaks; method 'l' add vertical lines over the peaks.  
\item[\code{main}] parameter of \code{\LinkA{plot}{plot}}
\item[\code{log}] parameter of \code{\LinkA{plot}{plot}} 
\item[\code{...}] other parameters of \code{\LinkA{points}{points}}
\end{ldescription}
\end{Arguments}
\begin{Author}\relax
Pan Du
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{peakDetectionCWT}{peakDetectionCWT}}, \code{\LinkA{identifyMajorPeaks}{identifyMajorPeaks}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
        data(exampleMS)
        SNR.Th <- 3
        peakInfo <- peakDetectionCWT(exampleMS, SNR.Th=SNR.Th)
        majorPeakInfo = peakInfo$majorPeakInfo
        peakIndex <- majorPeakInfo$peakIndex
        plotPeak(exampleMS, peakIndex, main=paste('Identified peaks with SNR >', SNR.Th)) 

\end{ExampleCode}
\end{Examples}

