83 template <
typename SpectrumType>
89 c1_ = (
double)param_.getValue(
"C1");
90 c2_ = (
double)param_.getValue(
"C2");
91 th_ = (
double)param_.getValue(
"threshold");
97 std::map<double, Size> peakranks;
98 for (ConstIterator it = spectrum.begin(); it != spectrum.end(); ++it)
100 peakranks[it->getIntensity()] = 0;
101 if (it->getIntensity() > maxint)
103 maxint = it->getIntensity();
107 for (std::map<double, Size>::reverse_iterator mit = peakranks.rbegin(); mit != peakranks.rend(); ++mit)
109 mit->second = ++rank;
114 for (
SignedSize i = spectrum.size() - 1; i >= 0; --i)
116 if (spectrum[i].getIntensity() > maxint * th_)
118 maxmz = spectrum[i].getMZ();
124 for (
Iterator it = spectrum.begin(); it != spectrum.end(); )
126 double newint = c1_ - (c2_ / maxmz) * peakranks[it->getIntensity()];
129 it = spectrum.erase(it);
133 it->setIntensity(newint);
142 void filterPeakMap(
PeakMap & exp);