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";
A more convenient string class.
Definition: String.h:57
void sortByPosition()
Lexicographically sorts the peaks by their position.
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:134
static const String getProductName()
Definition: NeutralLossMarker.h:131
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
PeakMarker marks peaks that seem to fulfill some criterion.
Definition: PeakMarker.h:47
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
void apply(std::map< double, bool > &marked, SpectrumType &spectrum)
Definition: NeutralLossMarker.h:81
static PeakMarker * create()
Definition: NeutralLossMarker.h:77
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
NeutralLossMarker marks peak pairs which could represent an ion an its neutral loss (water...
Definition: NeutralLossMarker.h:51