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";
A more convenient string class.
Definition: String.h:57
Isotope pattern generator for coarse isotope distributions.
Definition: CoarseIsotopePatternGenerator.h:88
void sortByPosition()
Lexicographically sorts the peaks by their position.
void apply(std::map< double, bool > &marked, SpectrumType &spectrum)
Definition: IsotopeMarker.h:87
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
static const String getProductName()
Definition: IsotopeMarker.h:137
PeakMarker marks peaks that seem to fulfill some criterion.
Definition: PeakMarker.h:47
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
static PeakMarker * create()
Definition: IsotopeMarker.h:83
IsotopeDistribution 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:127
IsotopeMarker marks peak pairs which could represent an ion and its isotope.
Definition: IsotopeMarker.h:57