Comparator implementation that scores query spectra against the library using BinnedSpectralContrastAngle on pre-binned spectra.
More...
#include <OpenMS/ANALYSIS/OPENSWATH/TargetedSpectraExtractor.h>
|
| | ~BinnedSpectrumComparator () override=default |
| |
| void | generateScores (const MSSpectrum &spec, std::vector< std::pair< Size, double > > &scores, double min_score) const override |
| | Bin spec with the configured bin parameters and score it against every entry of the cached library; keep only matches >= min_score.
|
| |
| void | init (const std::vector< MSSpectrum > &library, const std::map< std::string, DataValue > &options) override |
| | Cache library, pre-binning each spectrum with the current parameters, and apply any options overrides.
|
| |
Comparator implementation that scores query spectra against the library using BinnedSpectralContrastAngle on pre-binned spectra.
The reference library is binned exactly once at init time and the cached BinnedSpectrum objects are reused across generateScores calls; only the query spectrum is re-binned on each call. Bin parameters can be overridden through the options map passed to init.
◆ ~BinnedSpectrumComparator()
◆ generateScores()
| void generateScores |
( |
const MSSpectrum & |
spec, |
|
|
std::vector< std::pair< Size, double > > & |
scores, |
|
|
double |
min_score |
|
) |
| const |
|
inlineoverridevirtual |
Bin spec with the configured bin parameters and score it against every entry of the cached library; keep only matches >= min_score.
The query spectrum is wrapped in a new BinnedSpectrum with the current bin_size, peak_spread, and bin_offset (no precursor m/z carried over) and then compared one-by-one against the cached library bins via BinnedSpectralContrastAngle.
- Parameters
-
| [in] | spec | Query spectrum to bin and score. |
| [out] | scores | Cleared on entry, then filled with (library_index, score) pairs for matches that clear the threshold; unsorted. |
| [in] | min_score | Lower bound on the kept score (inclusive). |
Implements TargetedSpectraExtractor::Comparator.
◆ init()
| void init |
( |
const std::vector< MSSpectrum > & |
library, |
|
|
const std::map< std::string, DataValue > & |
options |
|
) |
| |
|
overridevirtual |
Cache library, pre-binning each spectrum with the current parameters, and apply any options overrides.
Honours three optional keys in options:
"bin_size" (double) — m/z bin width. Default 0.02 (suited for high-resolution data; the comment in the header lists 1.0 as the nominal-mass default).
"peak_spread" (UInt) — how many neighbour bins receive contributions from each peak. Default 0.
"bin_offset" (double) — m/z offset added to the bin boundaries. Default 0.0.
Both the inherited library_ vector and the internal bs_library_ vector of BinnedSpectrum objects are cleared and rebuilt on every call. Emits one OPENMS_LOG_INFO line reporting the loaded library size.
Implements TargetedSpectraExtractor::Comparator.
◆ bin_offset_
◆ bin_size_
◆ bs_library_
◆ cmp_bs_
◆ peak_spread_