35 #ifndef OPENMS_FILTERING_TRANSFORMERS_COMPLEMENTMARKER_H 
   36 #define OPENMS_FILTERING_TRANSFORMERS_COMPLEMENTMARKER_H 
   81     template <
typename SpectrumType>
 
   82     void apply(std::map<double, bool> marked, SpectrumType & spectrum)
 
   84       if (spectrum.size() < 2)
 
   90       double marks = (
double)param_.getValue(
"marks");
 
   91       double parentmass = 0.0;
 
   92       if (!spectrum.getPrecursors().empty()) parentmass = spectrum.getPrecursors()[0].getMZ();
 
   93       double tolerance = (
double)param_.getValue(
"tolerance");
 
   94       std::map<double, int> matching_b_y_ions;
 
   96       spectrum.sortByPosition();
 
   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:56
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference. 
Definition: Types.h:151
PeakMarker marks peaks that seem to fulfill some criterion. 
Definition: PeakMarker.h:48
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:144
static const String getProductName()
returns the name to register at the factory 
Definition: ComplementMarker.h:125