80 template <
typename SpectrumType>
83 if (spectrum.size() < 2)
89 double marks = (double)param_.getValue(
"marks");
90 double parentmass = 0.0;
92 double tolerance = (double)param_.getValue(
"tolerance");
93 std::map<double, int> matching_b_y_ions;
98 for (
Size i = 0; i < spectrum.size(); ++i)
100 while (j >= 0 && spectrum[j].getPosition()[0] > (parentmass - spectrum[i].getPosition()[0]) + tolerance)
106 if (j >= 0 && std::fabs(spectrum[i].getPosition()[0] + spectrum[j].getPosition()[0] - parentmass) < tolerance)
108 matching_b_y_ions[spectrum[i].getPosition()[0]]++;
109 matching_b_y_ions[spectrum[j].getPosition()[0]]++;
114 for (std::map<double, int>::const_iterator cmit = matching_b_y_ions.begin(); cmit != matching_b_y_ions.end(); ++cmit)
116 if (cmit->second >= marks)
118 marked.insert(std::pair<double, bool>(cmit->first,
true));
126 return "ComplementMarker";
ComplementMarker marks peak pairs which could represent y - b ion pairs.
Definition: ComplementMarker.h:53
ComplementMarker(const ComplementMarker &source)
copy constructor
void apply(std::map< double, bool > marked, SpectrumType &spectrum)
Definition: ComplementMarker.h:81
~ComplementMarker() override
destructor
static const String getProductName()
returns the name to register at the factory
Definition: ComplementMarker.h:124
The representation of a 1D spectrum.
Definition: MSSpectrum.h:70
void sortByPosition()
Lexicographically sorts the peaks by their position.
PeakMarker marks peaks that seem to fulfill some criterion.
Definition: PeakMarker.h:49
const std::vector< Precursor > & getPrecursors() const
returns a const reference to the precursors
A more convenient string class.
Definition: String.h:60
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:134
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47