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