86 template <
typename SpectrumType>
89 double mzvariation = (double)param_.getValue(
"mz_variation");
90 double invariation = (double)param_.getValue(
"in_variation");
91 Size marks = param_.getValue(
"marks");
95 std::map<double, Size> isotopemarks;
97 for (
Size i = 0; i < spectrum.size(); ++i)
99 double mz = spectrum[i].getPosition()[0];
100 double intensity = spectrum[i].getIntensity();
107 while (j < spectrum.size() && spectrum[j].getPosition()[0] <= mz + 3 + mzvariation)
109 double curmz = spectrum[j].getPosition()[0];
110 double curIntensity = spectrum[j].getIntensity();
111 UInt iso = (
UInt)(curmz - mz + 0.499999);
112 if (iso > 0 && curmz - mz - iso > mzvariation)
117 if (std::fabs(
id.begin()->getIntensity() * intensity - curIntensity) < invariation *
id.begin()->getIntensity() * intensity)
120 isotopemarks[curmz]++;
126 for (std::map<double, Size>::const_iterator cmit = isotopemarks.begin(); cmit != isotopemarks.end(); ++cmit)
128 if (cmit->second >= marks)
130 marked.insert(std::pair<double, bool>(cmit->first,
true));
139 return "IsotopeMarker";
Isotope pattern generator for coarse isotope distributions.
Definition: CoarseIsotopePatternGenerator.h:98
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:59
IsotopeMarker()
default constructor
IsotopeMarker(const IsotopeMarker &source)
copy constructor
static PeakMarker * create()
Definition: IsotopeMarker.h:83
void apply(std::map< double, bool > &marked, SpectrumType &spectrum)
Definition: IsotopeMarker.h:87
~IsotopeMarker() override
destructor
IsotopeMarker & operator=(const IsotopeMarker &source)
assignment operator
static const String getProductName()
Definition: IsotopeMarker.h:137
The representation of a 1D spectrum.
Definition: MSSpectrum.h:71
void sortByPosition()
Lexicographically sorts the peaks by their position.
PeakMarker marks peaks that seem to fulfill some criterion.
Definition: PeakMarker.h:49
A more convenient string class.
Definition: String.h:61
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
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