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";
A FilterFunctor extracts some spectrum characteristics for quality assessment.
Definition: FilterFunctor.h:46
GoodDiffFilter counts the number ob peak pairs whose m/z difference can be explained by a amino acid ...
Definition: GoodDiffFilter.h:55
~GoodDiffFilter() override
destructor
GoodDiffFilter()
default constructor
static FilterFunctor * create()
Definition: GoodDiffFilter.h:79
GoodDiffFilter & operator=(const GoodDiffFilter &source)
assignment operator
std::map< double, char > aamass_
list of unique amino acid masses
Definition: GoodDiffFilter.h:144
double apply(SpectrumType &spectrum)
Definition: GoodDiffFilter.h:83
GoodDiffFilter(const GoodDiffFilter &source)
copy constructor
static const String getProductName()
Definition: GoodDiffFilter.h:133
The representation of a 1D spectrum.
Definition: MSSpectrum.h:71
A more convenient string class.
Definition: String.h:61
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