35 #ifndef OPENMS_FILTERING_TRANSFORMERS_ISOTOPEDIFFFILTER_H 36 #define OPENMS_FILTERING_TRANSFORMERS_ISOTOPEDIFFFILTER_H 80 template <
typename SpectrumType>
83 double tolerance = (
double)param_.getValue(
"tolerance");
87 for (
Size i = 0; i < spectrum.size(); ++i)
89 for (
Size j = 1; i + j < spectrum.size(); ++j)
91 double pos_ij = spectrum[i + j].getPosition()[0];
92 double pos_i = spectrum[i].getPosition()[0];
93 if (std::fabs(pos_ij - pos_i + 1) < tolerance)
95 isodiff += spectrum[i].getIntensity() + spectrum[i + j].getIntensity();
99 if (std::fabs(spectrum[i + j].getPosition()[0] - spectrum[i].getPosition()[0]) > 1 + tolerance)
112 return "IsotopeDiffFilter";
120 #endif // OPENMS_FILTERING_TRANSFORMERS_ISOTOPEDIFFFILTER_H A more convenient string class.
Definition: String.h:57
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
static const String getProductName()
Definition: IsotopeDiffFilter.h:110
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
IsotopeDiffFilter returns total intensity of peak pairs that could result from isotope peaks...
Definition: IsotopeDiffFilter.h:50
A FilterFunctor extracts some spectrum characteristics for quality assessment.
Definition: FilterFunctor.h:45
double apply(SpectrumType &spectrum)
Definition: IsotopeDiffFilter.h:81
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
static FilterFunctor * create()
Definition: IsotopeDiffFilter.h:77