80 template <
typename SpectrumType>
84 double marks = (double)param_.getValue(
"marks");
85 double tolerance = (double)param_.getValue(
"tolerance");
86 std::map<double, SignedSize> ions_w_neutrallosses;
88 for (
Size i = 0; i < spectrum.size(); ++i)
90 double mz = spectrum[i].getPosition()[0];
91 double intensity = spectrum[i].getIntensity();
95 double curmz = spectrum[j].getPosition()[0];
96 double curIntensity = spectrum[j].getIntensity();
99 if (std::fabs(mz - curmz - 17) < tolerance || std::fabs(mz - curmz - 18) < tolerance)
102 if (curIntensity < intensity)
104 ions_w_neutrallosses[mz]++;
111 if (mz - curmz > 18.3)
120 for (std::map<double, SignedSize>::const_iterator cmit = ions_w_neutrallosses.begin(); cmit != ions_w_neutrallosses.end(); ++cmit)
122 if (cmit->second >= marks)
124 marked.insert(std::pair<double, bool>(cmit->first,
true));
133 return "NeutralLossMarker";
The representation of a 1D spectrum.
Definition: MSSpectrum.h:71
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:53
NeutralLossMarker(const NeutralLossMarker &source)
copy constructor
NeutralLossMarker()
default constructor
NeutralLossMarker & operator=(const NeutralLossMarker &source)
assignment operator
static PeakMarker * create()
Definition: NeutralLossMarker.h:77
void apply(std::map< double, bool > &marked, SpectrumType &spectrum)
Definition: NeutralLossMarker.h:81
~NeutralLossMarker() override
destructor
static const String getProductName()
Definition: NeutralLossMarker.h:131
PeakMarker marks peaks that seem to fulfill some criterion.
Definition: PeakMarker.h:49
A more convenient string class.
Definition: String.h:61
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:134
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47