36 #ifndef OPENMS_FILTERING_TRANSFORMERS_GOODDIFFFILTER_H 37 #define OPENMS_FILTERING_TRANSFORMERS_GOODDIFFFILTER_H 83 template <
typename SpectrumType>
86 double tolerance = (
double)param_.getValue(
"tolerance");
90 for (
Size i = 0; i < spectrum.size(); ++i)
93 for (
Size j = i; i + j < spectrum.size(); ++j)
95 double diff = spectrum[i + j].getPosition()[0] - spectrum[i].getPosition()[0];
107 totaldiff += spectrum[i + j].getIntensity() + spectrum[i].getIntensity();
108 std::map<double, char>::const_iterator aait = aamass_.lower_bound(diff);
109 if (aait == aamass_.end())
114 if (fabs(aait->first - diff) <= tolerance)
116 gooddiff += spectrum[i + j].getIntensity() + spectrum[i].getIntensity();
121 if ((aait) != aamass_.end() && fabs((aait)->first - diff) <= tolerance)
123 gooddiff += spectrum[i + j].getIntensity() + spectrum[i].getIntensity();
130 return gooddiff / totaldiff;
136 return "GoodDiffFilter";
149 #endif // OPENMS_FILTERING_TRANSFORMERS_GOODDIFFFILTER_H double apply(SpectrumType &spectrum)
Definition: GoodDiffFilter.h:84
A more convenient string class.
Definition: String.h:57
GoodDiffFilter counts the number ob peak pairs whose m/z difference can be explained by a amino acid ...
Definition: GoodDiffFilter.h:54
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
A FilterFunctor extracts some spectrum characteristics for quality assessment.
Definition: FilterFunctor.h:45
static const String getProductName()
Definition: GoodDiffFilter.h:134
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
static FilterFunctor * create()
Definition: GoodDiffFilter.h:80
std::map< double, char > aamass_
list of unique amino acid masses
Definition: GoodDiffFilter.h:145