35 #ifndef OPENMS_FILTERING_TRANSFORMERS_NEUTRALLOSSMARKER_H 36 #define OPENMS_FILTERING_TRANSFORMERS_NEUTRALLOSSMARKER_H 81 template <
typename SpectrumType>
85 double marks = (
double)param_.getValue(
"marks");
86 double tolerance = (
double)param_.getValue(
"tolerance");
87 std::map<double, SignedSize> ions_w_neutrallosses;
89 for (
Size i = 0; i < spectrum.size(); ++i)
91 double mz = spectrum[i].getPosition()[0];
92 double intensity = spectrum[i].getIntensity();
96 double curmz = spectrum[j].getPosition()[0];
97 double curIntensity = spectrum[j].getIntensity();
100 if (std::fabs(mz - curmz - 17) < tolerance || std::fabs(mz - curmz - 18) < tolerance)
103 if (curIntensity < intensity)
105 ions_w_neutrallosses[mz]++;
112 if (mz - curmz > 18.3)
121 for (std::map<double, SignedSize>::const_iterator cmit = ions_w_neutrallosses.begin(); cmit != ions_w_neutrallosses.end(); ++cmit)
123 if (cmit->second >= marks)
125 marked.insert(std::pair<double, bool>(cmit->first,
true));
134 return "NeutralLossMarker";
142 #endif //OPENMS_FILTERING_TRANSFORMERS_NEUTRALLOSSMARKER_H 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:135
static const String getProductName()
Definition: NeutralLossMarker.h:132
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
PeakMarker marks peaks that seem to fulfill some criterion.
Definition: PeakMarker.h:48
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
void apply(std::map< double, bool > &marked, SpectrumType &spectrum)
Definition: NeutralLossMarker.h:82
static PeakMarker * create()
Definition: NeutralLossMarker.h:78
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
NeutralLossMarker marks peak pairs which could represent an ion an its neutral loss (water...
Definition: NeutralLossMarker.h:52