MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / filterSpectrum

Function filterSpectrum

src/openms_gui/source/VISUAL/VISITORS/LayerStoreData.cpp:52–65  ·  view source on GitHub ↗

helper to filter a single MS1 spectrum Returns true if filtered spectrum contains data

Source from the content-addressed store, hash-verified

50 // helper to filter a single MS1 spectrum
51 // Returns true if filtered spectrum contains data
52 bool filterSpectrum(const MSSpectrum& in, MSSpectrum& out, const RangeAllType& visible_range, const DataFilters& layer_filters)
53 {
54 out = in;
55 out.clear(false); // keep metadata
56 auto it_end = in.MZEnd(visible_range.getMaxMZ());
57 for (auto it = in.MZBegin(visible_range.getMinMZ()); it != it_end; ++it)
58 {
59 if (layer_filters.passes(in, it - in.begin()))
60 {
61 out.push_back(*it);
62 }
63 }
64 return !out.empty();
65 }
66
67 void LayerStoreDataPeakMapVisible::storeVisibleSpectrum(const MSSpectrum& spec, const RangeAllType& visible_range, const DataFilters& layer_filters)
68 {

Callers 2

storeVisibleSpectrumMethod · 0.70

Calls 9

getMaxMZMethod · 0.80
getMinMZMethod · 0.80
passesMethod · 0.80
clearMethod · 0.45
MZEndMethod · 0.45
MZBeginMethod · 0.45
beginMethod · 0.45
push_backMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected