tuneInPeakInfo(): Fix several crashes:
Error in strsplit(ridgeName, "_") : non-character argument; the peak is now
reported as unprocessed instead.tuneInPeakInfo() with peakIndex/peakScale directly
(instead of majorPeakInfo) no longer crashes with Error in names<-.Deprecated the internal, unexported functions getRidgeValue(), i2u(),
u2i(), mzInd2vRange(), mzV2indRange() and smoothDWT(). These
functions appear to be unused, both internally in MassSpecWavelet and by
known downstream packages, and are scheduled for removal in a future
release. If you rely on any of them (e.g. via :::), please open an
issue at https://github.com/zeehio/MassSpecWavelet/issues.
Migrated the unit test suite from RUnit to testthat (3rd edition). Tests now
live in tests/testthat/ instead of inst/tests/, following the standard
testthat package layout. Significant increased in test coverage.
identifyMajorPeaks(): Fix Error in strsplit(ridgeName, "_") : non-character argument crash when no ridges are found (e.g. for a flat/constant input
signal). An empty (but well-formed) result is now returned instead.
getRidge(): Fix ridge name/lookup mismatches on high resolution spectra
(m/z indices at or above 1e5). Ridge indices were internally promoted from
integer to double partway through the tracing loop, and R's default
number-to-string coercion uses scientific notation for large "round"
doubles (e.g. 200000 -> "2e+05") but never for integers. The same peak
could therefore end up keyed under two different strings, causing the
internal ridge lookup to silently miss and ridges to be dropped or
duplicated. Ridge names are now always built with a representation-
independent formatting helper. Thanks to drobertsicl for reporting the
issue and suggesting the fix. Closes #8
identifyMajorPeaks():
SNR.Th=0 and excludeBoundariesSize=0
cases to bypass those filtering criteria.Fix NOTE on escaping special LaTeX characters
cwt() when scales has length 1.getRidge() supports a scaleToWinSize parameter. This argument controls how
scales get mapped to window sizes. These windows are used to track the local
maxima into ridges. MassSpecWavelet had a criteria of winsize <- 2*scale+1,
while xcms modified it to winsize <- floor(scale/2). This new argument enables
xcms maintainers to call MassSpecWavelet's getRidge (if they want to) using their
criteria, while it still lets us preserve backwards compatibility in our results.
See ?getRidge for further details.
The getLocalMaximumCWT() is_amp_thres_relative parameter is now isAmpThreshRelative,
for consistency with other parameter capitalization in the package. Since it
was introduced 10 days ago, I don't think there will be more than one user using
it.
getLocalMaximumCWT() and peakDetectionCWT have a exclude0scaleAmpThresh
parameter. When computing the relative amp.Th, if this parameter is set
to TRUE, the amp.Th will exclude the zero-th scale from the
max(wCoefs). The zero-th scale corresponds to the original signal, that may
have a much larger baseline than the wavelet coefficients and can distort the
threshold calculation. The default value is FALSE to preserve backwards
compatibility.
peakDetectionCWT lets the user pass custom arguments to getRidge().
The improvements in localMaxima() and cwt() provide significant speed-ups
to peakDetectionCWT() as well as better scalability.
A prepareWavelets() function lets the user pre-compute the daughter wavelets
for more efficient cwt() calculations when applied on multiple spectra. When
used transforming 1000 spectra, of 2000 points long each, using 25 different
scales, cwt() is twice as fast as in previous versions. Further improvements
to avoid some memory allocations are still feasible in future versions.
Through the prepareWavelets() function, we provide the extendLengthScales
argument, that provides the same functionality than the extendLengthMSW argument
in xcms:::MSW.cwt().
The peakDetectionCWT() function accepts a prepared_wavelets object in the
scales argument for better efficiency.
localMaxima() has a more efficient implementation of the algorithm, now being
10x faster than before, while giving the same results.
Experimentally, localMaxima() can use a new and different algorithm for
detecting local maxima. See the new "Finding local maxima" vignette for
further details.
cwt() has a matrix in the wavelet argumentsd -> stats::sd)man/ files.