82 template <
typename SpectrumType>
85 double tolerance = (
double)param_.getValue(
"tolerance");
89 for (
Size i = 0; i < spectrum.size(); ++i)
92 for (
Size j = i; i + j < spectrum.size(); ++j)
94 double diff = spectrum[i + j].getPosition()[0] - spectrum[i].getPosition()[0];
106 totaldiff += spectrum[i + j].getIntensity() + spectrum[i].getIntensity();
107 std::map<double, char>::const_iterator aait = aamass_.lower_bound(diff);
108 if (aait == aamass_.end())
113 if (fabs(aait->first - diff) <= tolerance)
115 gooddiff += spectrum[i + j].getIntensity() + spectrum[i].getIntensity();
120 if ((aait) != aamass_.end() && fabs((aait)->first - diff) <= tolerance)
122 gooddiff += spectrum[i + j].getIntensity() + spectrum[i].getIntensity();
129 return gooddiff / totaldiff;
135 return "GoodDiffFilter";
double apply(SpectrumType &spectrum)
Definition: GoodDiffFilter.h:83
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:53
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
A FilterFunctor extracts some spectrum characteristics for quality assessment.
Definition: FilterFunctor.h:44
static const String getProductName()
Definition: GoodDiffFilter.h:133
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
static FilterFunctor * create()
Definition: GoodDiffFilter.h:79
std::map< double, char > aamass_
list of unique amino acid masses
Definition: GoodDiffFilter.h:144