52 template <
typename SpectrumType>
56 double marks = (double)param_.getValue(
"marks");
57 double tolerance = (double)param_.getValue(
"tolerance");
58 std::map<double, SignedSize> ions_w_neutrallosses;
60 for (
Size i = 0; i < spectrum.size(); ++i)
62 double mz = spectrum[i].getPosition()[0];
63 double intensity = spectrum[i].getIntensity();
67 double curmz = spectrum[j].getPosition()[0];
68 double curIntensity = spectrum[j].getIntensity();
71 if (std::fabs(mz - curmz - 17) < tolerance || std::fabs(mz - curmz - 18) < tolerance)
74 if (curIntensity < intensity)
76 ions_w_neutrallosses[mz]++;
83 if (mz - curmz > 18.3)
92 for (std::map<double, SignedSize>::const_iterator cmit = ions_w_neutrallosses.begin(); cmit != ions_w_neutrallosses.end(); ++cmit)
94 if (cmit->second >= marks)
96 marked.insert(std::pair<double, bool>(cmit->first,
true));
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
void sortByPosition()
Lexicographically sorts the peaks by their position.
NeutralLossMarker marks peak pairs which could represent an ion an its neutral loss (water,...
Definition: NeutralLossMarker.h:27
NeutralLossMarker(const NeutralLossMarker &source)
copy constructor
NeutralLossMarker()
default constructor
NeutralLossMarker & operator=(const NeutralLossMarker &source)
assignment operator
void apply(std::map< double, bool > &marked, SpectrumType &spectrum)
Definition: NeutralLossMarker.h:53
~NeutralLossMarker() override
destructor
PeakMarker marks peaks that seem to fulfill some criterion.
Definition: PeakMarker.h:23
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:104
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19