35 #ifndef OPENMS_FILTERING_TRANSFORMERS_COMPLEMENTMARKER_H 36 #define OPENMS_FILTERING_TRANSFORMERS_COMPLEMENTMARKER_H 81 template <
typename SpectrumType>
84 if (spectrum.size() < 2)
90 double marks = (
double)param_.getValue(
"marks");
91 double parentmass = 0.0;
93 double tolerance = (
double)param_.getValue(
"tolerance");
94 std::map<double, int> matching_b_y_ions;
99 for (
Size i = 0; i < spectrum.size(); ++i)
101 while (j >= 0 && spectrum[j].getPosition()[0] > (parentmass - spectrum[i].getPosition()[0]) + tolerance)
107 if (j >= 0 && std::fabs(spectrum[i].getPosition()[0] + spectrum[j].getPosition()[0] - parentmass) < tolerance)
109 matching_b_y_ions[spectrum[i].getPosition()[0]]++;
110 matching_b_y_ions[spectrum[j].getPosition()[0]]++;
115 for (std::map<double, int>::const_iterator cmit = matching_b_y_ions.begin(); cmit != matching_b_y_ions.end(); ++cmit)
117 if (cmit->second >= marks)
119 marked.insert(std::pair<double, bool>(cmit->first,
true));
127 return "ComplementMarker";
135 #endif //OPENMS_FILTERING_TRANSFORMERS_COMPLEMENTMARKER_H ComplementMarker marks peak pairs which could represent y - b ion pairs.
Definition: ComplementMarker.h:52
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
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
const std::vector< Precursor > & getPrecursors() const
returns a const reference to the precursors
void apply(std::map< double, bool > marked, SpectrumType &spectrum)
Definition: ComplementMarker.h:82
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
static const String getProductName()
returns the name to register at the factory
Definition: ComplementMarker.h:125