\HeaderA{specNoise}{Calculate noise for a sparse continuum mass spectrum}{specNoise}
\keyword{manip}{specNoise}
\begin{Description}\relax
Given a sparse continuum mass spectrum, determine regions where
no signal is present, substituting half of the minimum intensity
for those regions. Calculate the noise level as the weighted mean
of the regions with signal and the regions without signal.
\end{Description}
\begin{Usage}
\begin{verbatim}
specNoise(spec, gap = quantile(diff(spec[, "mz"]), 0.9))
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{spec}] matrix with named columns \code{mz} and \code{intensity}
\item[\code{gap}] threshold above which to data points are considerd to be separated
by a blank region and not bridged by an interpolating line

\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The default gap value is determined from the 90th percentile of
the pair-wise differences between adjacent mass values.
\end{Details}
\begin{Value}
A numeric noise level
\end{Value}
\begin{Author}\relax
Colin A. Smith, \email{csmith@scripps.edu}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{getSpec}{getSpec}},
\code{\LinkA{specPeaks}{specPeaks}}
\end{SeeAlso}

