35 #ifndef OPENMS_FILTERING_TRANSFORMERS_ISOTOPEMARKER_H 36 #define OPENMS_FILTERING_TRANSFORMERS_ISOTOPEMARKER_H 87 template <
typename SpectrumType>
90 double mzvariation = (
double)param_.getValue(
"mz_variation");
91 double invariation = (
double)param_.getValue(
"in_variation");
92 Size marks = param_.getValue(
"marks");
96 std::map<double, Size> isotopemarks;
98 for (
Size i = 0; i < spectrum.size(); ++i)
100 double mz = spectrum[i].getPosition()[0];
101 double intensity = spectrum[i].getIntensity();
108 while (j < spectrum.size() && spectrum[j].getPosition()[0] <= mz + 3 + mzvariation)
110 double curmz = spectrum[j].getPosition()[0];
111 double curIntensity = spectrum[j].getIntensity();
112 UInt iso = (
UInt)(curmz - mz + 0.499999);
113 if (iso > 0 && curmz - mz - iso > mzvariation)
118 if (std::fabs(
id.begin()->second * intensity - curIntensity) < invariation *
id.begin()->second * intensity)
121 isotopemarks[curmz]++;
127 for (std::map<double, Size>::const_iterator cmit = isotopemarks.begin(); cmit != isotopemarks.end(); ++cmit)
129 if (cmit->second >= marks)
131 marked.insert(std::pair<double, bool>(cmit->first,
true));
140 return "IsotopeMarker";
149 #endif //OPENMS_FILTERING_TRANSFORMERS_ISOTOPEMARKER_H A more convenient string class.
Definition: String.h:57
void sortByPosition()
Lexicographically sorts the peaks by their position.
void apply(std::map< double, bool > &marked, SpectrumType &spectrum)
Definition: IsotopeMarker.h:88
unsigned int UInt
Unsigned integer type.
Definition: Types.h:95
Isotope distribution class.
Definition: IsotopeDistribution.h:62
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
static const String getProductName()
Definition: IsotopeMarker.h:138
PeakMarker marks peaks that seem to fulfill some criterion.
Definition: PeakMarker.h:48
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
static PeakMarker * create()
Definition: IsotopeMarker.h:84
void estimateFromPeptideWeight(double average_weight)
Estimate Peptide Isotopedistribution from weight and number of isotopes that should be reported...
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
IsotopeMarker marks peak pairs which could represent an ion and its isotope.
Definition: IsotopeMarker.h:58