86 template <
typename SpectrumType>
89 double mzvariation = (
double)param_.getValue(
"mz_variation");
90 double invariation = (
double)param_.getValue(
"in_variation");
91 Size marks = param_.getValue(
"marks");
95 std::map<double, Size> isotopemarks;
97 for (
Size i = 0; i < spectrum.size(); ++i)
99 double mz = spectrum[i].getPosition()[0];
100 double intensity = spectrum[i].getIntensity();
107 while (j < spectrum.size() && spectrum[j].getPosition()[0] <= mz + 3 + mzvariation)
109 double curmz = spectrum[j].getPosition()[0];
110 double curIntensity = spectrum[j].getIntensity();
111 UInt iso = (
UInt)(curmz - mz + 0.499999);
112 if (iso > 0 && curmz - mz - iso > mzvariation)
117 if (std::fabs(
id.begin()->getIntensity() * intensity - curIntensity) < invariation *
id.begin()->getIntensity() * intensity)
120 isotopemarks[curmz]++;
126 for (std::map<double, Size>::const_iterator cmit = isotopemarks.begin(); cmit != isotopemarks.end(); ++cmit)
128 if (cmit->second >= marks)
130 marked.insert(std::pair<double, bool>(cmit->first,
true));
139 return "IsotopeMarker";