60 template <
typename SpectrumType>
63 double mzvariation = (double)param_.getValue(
"mz_variation");
64 double invariation = (double)param_.getValue(
"in_variation");
65 Size marks = param_.getValue(
"marks");
69 std::map<double, Size> isotopemarks;
71 for (
Size i = 0; i < spectrum.size(); ++i)
73 double mz = spectrum[i].getPosition()[0];
74 double intensity = spectrum[i].getIntensity();
81 while (j < spectrum.size() && spectrum[j].getPosition()[0] <= mz + 3 + mzvariation)
83 double curmz = spectrum[j].getPosition()[0];
84 double curIntensity = spectrum[j].getIntensity();
85 UInt iso = (
UInt)(curmz - mz + 0.499999);
86 if (iso > 0 && curmz - mz - iso > mzvariation)
91 if (std::fabs(
id.begin()->getIntensity() * intensity - curIntensity) < invariation *
id.begin()->getIntensity() * intensity)
94 isotopemarks[curmz]++;
100 for (std::map<double, Size>::const_iterator cmit = isotopemarks.begin(); cmit != isotopemarks.end(); ++cmit)
102 if (cmit->second >= marks)
104 marked.insert(std::pair<double, bool>(cmit->first,
true));
113 return "IsotopeMarker";
Isotope pattern generator for coarse isotope distributions.
Definition: CoarseIsotopePatternGenerator.h:79
IsotopeDistribution estimateFromPeptideWeight(double average_weight)
Estimate Peptide Isotopedistribution from weight and number of isotopes that should be reported.
IsotopeMarker marks peak pairs which could represent an ion and its isotope.
Definition: IsotopeMarker.h:33
IsotopeMarker()
default constructor
IsotopeMarker(const IsotopeMarker &source)
copy constructor
static PeakMarker * create()
Definition: IsotopeMarker.h:57
void apply(std::map< double, bool > &marked, SpectrumType &spectrum)
Definition: IsotopeMarker.h:61
~IsotopeMarker() override
destructor
IsotopeMarker & operator=(const IsotopeMarker &source)
assignment operator
static const String getProductName()
Definition: IsotopeMarker.h:111
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
void sortByPosition()
Lexicographically sorts the peaks by their position.
PeakMarker marks peaks that seem to fulfill some criterion.
Definition: PeakMarker.h:23
A more convenient string class.
Definition: String.h:34
unsigned int UInt
Unsigned integer type.
Definition: Types.h:68
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22