Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
PeakPickerHiRes.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2017.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Author: Erhan Kenar $
32 // $Maintainer: Timo Sachsenberg $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
43 
45 
46 
47 #define DEBUG_PEAK_PICKING
48 #undef DEBUG_PEAK_PICKING
49 //#undef DEBUG_DECONV
50 namespace OpenMS
51 {
75  class OPENMS_DLLAPI PeakPickerHiRes :
76  public DefaultParamHandler,
77  public ProgressLogger
78  {
79 public:
82 
84  ~PeakPickerHiRes() override;
85 
87  struct PeakBoundary
88  {
89  double mz_min;
90  double mz_max;
91  };
92 
101  void pick(const MSSpectrum& input, MSSpectrum& output) const
102  {
103  std::vector<PeakBoundary> boundaries;
104  pick(input, output, boundaries);
105  }
106 
114  void pick(const MSChromatogram& input, MSChromatogram& output) const
115  {
116  std::vector<PeakBoundary> boundaries;
117  pick(input, output, boundaries);
118  }
119 
130  void pick(const MSSpectrum& input, MSSpectrum& output, std::vector<PeakBoundary>& boundaries, bool check_spacings = true) const
131  {
132  // copy meta data of the input spectrum
133  output.clear(true);
134  output.SpectrumSettings::operator=(input);
135  output.MetaInfoInterface::operator=(input);
136  output.setRT(input.getRT());
137  output.setMSLevel(input.getMSLevel());
138  output.setName(input.getName());
140  if (report_FWHM_)
141  {
142  output.getFloatDataArrays().resize(1);
143  output.getFloatDataArrays()[0].setName( report_FWHM_as_ppm_ ? "FWHM_ppm" : "FWHM");
144  }
145 
146  // don't pick a spectrum with less than 5 data points
147  if (input.size() < 5) return;
148 
149  // if both spacing constraints are disabled, don't check spacings at all:
150  if ((spacing_difference_ == std::numeric_limits<double>::infinity()) &&
151  (spacing_difference_gap_ == std::numeric_limits<double>::infinity()))
152  {
153  check_spacings = false;
154  }
155 
156  // signal-to-noise estimation
158  snt.setParameters(param_.copy("SignalToNoise:", true));
159 
160  if (signal_to_noise_ > 0.0)
161  {
162  snt.init(input);
163  }
164 
165  // find local maxima in profile data
166  for (Size i = 2; i < input.size() - 2; ++i)
167  {
168  double central_peak_mz = input[i].getMZ(), central_peak_int = input[i].getIntensity();
169  double left_neighbor_mz = input[i - 1].getMZ(), left_neighbor_int = input[i - 1].getIntensity();
170  double right_neighbor_mz = input[i + 1].getMZ(), right_neighbor_int = input[i + 1].getIntensity();
171 
172  // do not interpolate when the left or right support is a zero-data-point
173  if (std::fabs(left_neighbor_int) < std::numeric_limits<double>::epsilon()) continue;
174  if (std::fabs(right_neighbor_int) < std::numeric_limits<double>::epsilon()) continue;
175 
176  // MZ spacing sanity checks
177  double left_to_central = 0.0, central_to_right = 0.0, min_spacing = 0.0;
178  if (check_spacings)
179  {
180  left_to_central = central_peak_mz - left_neighbor_mz;
181  central_to_right = right_neighbor_mz - central_peak_mz;
182  min_spacing = (left_to_central < central_to_right) ? left_to_central : central_to_right;
183  }
184 
185  double act_snt = 0.0, act_snt_l1 = 0.0, act_snt_r1 = 0.0;
186  if (signal_to_noise_ > 0.0)
187  {
188  act_snt = snt.getSignalToNoise(input[i]);
189  act_snt_l1 = snt.getSignalToNoise(input[i - 1]);
190  act_snt_r1 = snt.getSignalToNoise(input[i + 1]);
191  }
192 
193  // look for peak cores meeting MZ and intensity/SNT criteria
194  if ((central_peak_int > left_neighbor_int) &&
195  (central_peak_int > right_neighbor_int) &&
196  (act_snt >= signal_to_noise_) &&
197  (act_snt_l1 >= signal_to_noise_) &&
198  (act_snt_r1 >= signal_to_noise_) &&
199  (!check_spacings ||
200  ((left_to_central < spacing_difference_ * min_spacing) &&
201  (central_to_right < spacing_difference_ * min_spacing))))
202  {
203  // special case: if a peak core is surrounded by more intense
204  // satellite peaks (indicates oscillation rather than
205  // real peaks) -> remove
206 
207  double act_snt_l2 = 0.0, act_snt_r2 = 0.0;
208 
209  if (signal_to_noise_ > 0.0)
210  {
211  act_snt_l2 = snt.getSignalToNoise(input[i - 2]);
212  act_snt_r2 = snt.getSignalToNoise(input[i + 2]);
213  }
214 
215  // checking signal-to-noise?
216  if ((i > 1) &&
217  (i + 2 < input.size()) &&
218  (left_neighbor_int < input[i - 2].getIntensity()) &&
219  (right_neighbor_int < input[i + 2].getIntensity()) &&
220  (act_snt_l2 >= signal_to_noise_) &&
221  (act_snt_r2 >= signal_to_noise_) &&
222  (!check_spacings ||
223  ((left_neighbor_mz - input[i - 2].getMZ() < spacing_difference_ * min_spacing) &&
224  (input[i + 2].getMZ() - right_neighbor_mz < spacing_difference_ * min_spacing))))
225  {
226  ++i;
227  continue;
228  }
229 
230  std::map<double, double> peak_raw_data;
231 
232  peak_raw_data[central_peak_mz] = central_peak_int;
233  peak_raw_data[left_neighbor_mz] = left_neighbor_int;
234  peak_raw_data[right_neighbor_mz] = right_neighbor_int;
235 
236  // peak core found, now extend it
237  // to the left
238  Size k = 2;
239 
240  bool previous_zero_left(false); // no need to extend peak if previous intensity was zero
241  Size missing_left(0);
242  Size left_boundary(i - 1); // index of the left boundary for the spline interpolation
243 
244  while ((k <= i) && // prevent underflow
245  (i - k + 1 > 0) &&
246  !previous_zero_left &&
247  (missing_left <= missing_) &&
248  (input[i - k].getIntensity() <= peak_raw_data.begin()->second) &&
249  (!check_spacings ||
250  (peak_raw_data.begin()->first - input[i - k].getMZ() < spacing_difference_gap_ * min_spacing)))
251  {
252  double act_snt_lk = 0.0;
253 
254  if (signal_to_noise_ > 0.0)
255  {
256  act_snt_lk = snt.getSignalToNoise(input[i - k]);
257  }
258 
259  if ((act_snt_lk >= signal_to_noise_) &&
260  (!check_spacings ||
261  (peak_raw_data.begin()->first - input[i - k].getMZ() < spacing_difference_ * min_spacing)))
262  {
263  peak_raw_data[input[i - k].getMZ()] = input[i - k].getIntensity();
264  }
265  else
266  {
267  ++missing_left;
268  if (missing_left <= missing_)
269  {
270  peak_raw_data[input[i - k].getMZ()] = input[i - k].getIntensity();
271  }
272  }
273 
274  previous_zero_left = (input[i - k].getIntensity() == 0);
275  left_boundary = i - k;
276  ++k;
277  }
278 
279  // to the right
280  k = 2;
281 
282  bool previous_zero_right(false); // no need to extend peak if previous intensity was zero
283  Size missing_right(0);
284  Size right_boundary(i+1); // index of the right boundary for the spline interpolation
285 
286  while ((i + k < input.size()) &&
287  !previous_zero_right &&
288  (missing_right <= missing_) &&
289  (input[i + k].getIntensity() <= peak_raw_data.rbegin()->second) &&
290  (!check_spacings ||
291  (input[i + k].getMZ() - peak_raw_data.rbegin()->first < spacing_difference_gap_ * min_spacing)))
292  {
293  double act_snt_rk = 0.0;
294 
295  if (signal_to_noise_ > 0.0)
296  {
297  act_snt_rk = snt.getSignalToNoise(input[i + k]);
298  }
299 
300  if ((act_snt_rk >= signal_to_noise_) &&
301  (!check_spacings ||
302  (input[i + k].getMZ() - peak_raw_data.rbegin()->first < spacing_difference_ * min_spacing)))
303  {
304  peak_raw_data[input[i + k].getMZ()] = input[i + k].getIntensity();
305  }
306  else
307  {
308  ++missing_right;
309  if (missing_right <= missing_)
310  {
311  peak_raw_data[input[i + k].getMZ()] = input[i + k].getIntensity();
312  }
313  }
314 
315  previous_zero_right = (input[i + k].getIntensity() == 0);
316  right_boundary = i + k;
317  ++k;
318  }
319 
320  // skip if the minimal number of 3 points for fitting is not reached
321  if (peak_raw_data.size() < 3) continue;
322 
323  CubicSpline2d peak_spline (peak_raw_data);
324 
325  // calculate maximum by evaluating the spline's 1st derivative
326  // (bisection method)
327  double max_peak_mz = central_peak_mz;
328  double max_peak_int = central_peak_int;
329  double threshold = 0.000001;
330  double lefthand = left_neighbor_mz;
331  double righthand = right_neighbor_mz;
332 
333  bool lefthand_sign = 1;
334  double eps = std::numeric_limits<double>::epsilon();
335 
336  // bisection
337  do
338  {
339  double mid = (lefthand + righthand) / 2.0;
340  double midpoint_deriv_val = peak_spline.derivatives(mid, 1);
341 
342  // if deriv nearly zero then maximum already found
343  if (!(std::fabs(midpoint_deriv_val) > eps))
344  {
345  break;
346  }
347 
348  bool midpoint_sign = (midpoint_deriv_val < 0.0) ? 0 : 1;
349 
350  if (lefthand_sign ^ midpoint_sign)
351  {
352  righthand = mid;
353  }
354  else
355  {
356  lefthand = mid;
357  }
358  }
359  while (righthand - lefthand > threshold);
360 
361  max_peak_mz = (lefthand + righthand) / 2;
362  max_peak_int = peak_spline.eval(max_peak_mz);
363 
364  //
365  // compute FWHM
366  //
367  if (report_FWHM_)
368  {
369  double fwhm_int = max_peak_int / 2.0;
370  threshold = 0.01 * fwhm_int;
371  double mz_mid, int_mid;
372  // left:
373  double mz_left = peak_raw_data.begin()->first;
374  double mz_center = max_peak_mz;
375  if (peak_spline.eval(mz_left) > fwhm_int)
376  { // the spline ends before half max is reached -- take the leftmost point (probably an underestimation)
377  mz_mid = mz_left;
378  } else
379  {
380  do
381  {
382  mz_mid = mz_left / 2 + mz_center / 2;
383  int_mid = peak_spline.eval(mz_mid);
384  if (int_mid < fwhm_int)
385  {
386  mz_left = mz_mid;
387  }
388  else
389  {
390  mz_center = mz_mid;
391  }
392  } while(fabs(int_mid - fwhm_int) > threshold);
393  }
394  const double fwhm_left_mz = mz_mid;
395 
396  // right ...
397  double mz_right = peak_raw_data.rbegin()->first;
398  mz_center = max_peak_mz;
399  if (peak_spline.eval(mz_right) > fwhm_int)
400  { // the spline ends before half max is reached -- take the rightmost point (probably an underestimation)
401  mz_mid = mz_right;
402  } else
403  {
404  do
405  {
406  mz_mid = mz_right / 2 + mz_center / 2;
407  int_mid = peak_spline.eval(mz_mid);
408  if (int_mid < fwhm_int)
409  {
410  mz_right = mz_mid;
411  }
412  else
413  {
414  mz_center = mz_mid;
415  }
416 
417  } while(fabs(int_mid - fwhm_int) > threshold);
418  }
419  const double fwhm_right_mz = mz_mid;
420  const double fwhm_absolute = fwhm_right_mz - fwhm_left_mz;
421  output.getFloatDataArrays()[0].push_back( report_FWHM_as_ppm_ ? fwhm_absolute / max_peak_mz * 1e6 : fwhm_absolute);
422  } // FWHM
423 
424  // save picked peak into output spectrum
425  Peak1D peak;
426  PeakBoundary peak_boundary;
427  peak.setMZ(max_peak_mz);
428  peak.setIntensity(max_peak_int);
429  peak_boundary.mz_min = input[left_boundary].getMZ();
430  peak_boundary.mz_max = input[right_boundary].getMZ();
431  output.push_back(peak);
432 
433  boundaries.push_back(peak_boundary);
434 
435  // jump over profile data points that have been considered already
436  i = i + k - 1;
437  }
438  }
439 
440  return;
441  }
442 
443 
452  void pick(const MSChromatogram& input, MSChromatogram& output, std::vector<PeakBoundary>& boundaries) const
453  {
454  // copy meta data of the input chromatogram
455  output.clear(true);
456  output.ChromatogramSettings::operator=(input);
457  output.MetaInfoInterface::operator=(input);
458  output.setName(input.getName());
459 
460  MSSpectrum input_spectrum;
461  MSSpectrum output_spectrum;
462  for (MSChromatogram::const_iterator it = input.begin(); it != input.end(); ++it)
463  {
464  Peak1D p;
465  p.setMZ(it->getRT());
466  p.setIntensity(it->getIntensity());
467  input_spectrum.push_back(p);
468  }
469 
470  pick(input_spectrum, output_spectrum, boundaries, false); // no spacing checks!
471 
472  for (MSSpectrum::const_iterator it = output_spectrum.begin(); it != output_spectrum.end(); ++it)
473  {
475  p.setRT(it->getMZ());
476  p.setIntensity(it->getIntensity());
477  output.push_back(p);
478  }
479 
480  // copy float data arrays (for FWHM)
481  output.getFloatDataArrays().resize(output_spectrum.getFloatDataArrays().size());
482  for (Size i = 0; i < output_spectrum.getFloatDataArrays().size(); ++i)
483  {
484  output.getFloatDataArrays()[i].insert(output.getFloatDataArrays()[i].begin(), output_spectrum.getFloatDataArrays()[i].begin(), output_spectrum.getFloatDataArrays()[i].end());
485  output.getFloatDataArrays()[i].setName(output_spectrum.getFloatDataArrays()[i].getName());
486  }
487  }
488 
498  void pickExperiment(const PeakMap& input, PeakMap& output, const bool check_spectrum_type = true) const
499  {
500  std::vector<std::vector<PeakBoundary> > boundaries_spec;
501  std::vector<std::vector<PeakBoundary> > boundaries_chrom;
502  pickExperiment(input, output, boundaries_spec, boundaries_chrom, check_spectrum_type);
503  }
504 
516  void pickExperiment(const PeakMap& input, PeakMap& output, std::vector<std::vector<PeakBoundary> >& boundaries_spec, std::vector<std::vector<PeakBoundary> >& boundaries_chrom, const bool check_spectrum_type = true) const
517  {
518  // make sure that output is clear
519  output.clear(true);
520 
521  // copy experimental settings
522  static_cast<ExperimentalSettings &>(output) = input;
523 
524  // resize output with respect to input
525  output.resize(input.size());
526 
527  Size progress = 0;
528  startProgress(0, input.size() + input.getChromatograms().size(), "picking peaks");
529 
530  if (input.getNrSpectra() > 0)
531  {
532  for (Size scan_idx = 0; scan_idx != input.size(); ++scan_idx)
533  {
534  if (!ListUtils::contains(ms_levels_, input[scan_idx].getMSLevel()))
535  {
536  output[scan_idx] = input[scan_idx];
537  }
538  else
539  {
540  std::vector<PeakBoundary> boundaries_s; // peak boundaries of a single spectrum
541 
542  // determine type of spectral data (profile or centroided)
543  SpectrumSettings::SpectrumType spectrum_type = input[scan_idx].getType();
544 
545  if (spectrum_type == SpectrumSettings::CENTROID && check_spectrum_type)
546  {
547  throw OpenMS::Exception::IllegalArgument(__FILE__, __LINE__, __FUNCTION__, "Error: Centroided data provided but profile spectra expected.");
548  }
549 
550  pick(input[scan_idx], output[scan_idx], boundaries_s);
551  boundaries_spec.push_back(boundaries_s);
552  }
553  setProgress(++progress);
554  }
555  }
556 
557 
558  for (Size i = 0; i < input.getChromatograms().size(); ++i)
559  {
560  MSChromatogram chromatogram;
561  std::vector<PeakBoundary> boundaries_c; // peak boundaries of a single chromatogram
562  pick(input.getChromatograms()[i], chromatogram, boundaries_c);
563  output.addChromatogram(chromatogram);
564  boundaries_chrom.push_back(boundaries_c);
565  setProgress(++progress);
566  }
567  endProgress();
568 
569  return;
570  }
571 
579  void pickExperiment(/* const */ OnDiscPeakMap& input, PeakMap& output, const bool check_spectrum_type = true) const
580  {
581  // make sure that output is clear
582  output.clear(true);
583 
584  // copy experimental settings
585  static_cast<ExperimentalSettings &>(output) = *input.getExperimentalSettings();
586 
587  Size progress = 0;
588  startProgress(0, input.size() + input.getNrChromatograms(), "picking peaks");
589 
590  if (input.getNrSpectra() > 0)
591  {
592 
593  // resize output with respect to input
594  output.resize(input.size());
595 
596  for (Size scan_idx = 0; scan_idx != input.size(); ++scan_idx)
597  {
598  if (!ListUtils::contains(ms_levels_, input[scan_idx].getMSLevel()))
599  {
600  output[scan_idx] = input[scan_idx];
601  }
602  else
603  {
604  MSSpectrum s = input[scan_idx];
605  s.sortByPosition();
606 
607  // determine type of spectral data (profile or centroided)
608  SpectrumSettings::SpectrumType spectrum_type = s.getType();
609 
610  if (spectrum_type == SpectrumSettings::CENTROID && check_spectrum_type)
611  {
612  throw OpenMS::Exception::IllegalArgument(__FILE__, __LINE__, __FUNCTION__, "Error: Centroided data provided but profile spectra expected.");
613  }
614 
615  pick(s, output[scan_idx]);
616  }
617  setProgress(++progress);
618  }
619  }
620 
621  for (Size i = 0; i < input.getNrChromatograms(); ++i)
622  {
623  MSChromatogram chromatogram;
624  pick(input.getChromatogram(i), chromatogram);
625  output.addChromatogram(chromatogram);
626  setProgress(++progress);
627  }
628  endProgress();
629 
630  return;
631  }
632 
633 protected:
634  // signal-to-noise parameter
636 
637  // maximal spacing difference defining a large gap
639 
640  // maximal spacing difference defining a missing data point
642 
643  // maximum number of missing points
644  unsigned missing_;
645 
646  // MS levels to which peak picking is applied
647  std::vector<Int> ms_levels_;
648 
651 
654 
655  // docu in base class
656  void updateMembers_() override;
657 
658  }; // end PeakPickerHiRes
659 
660 } // namespace OpenMS
661 
bool report_FWHM_
add floatDataArray &#39;FWHM&#39;/&#39;FWHM_ppm&#39; to spectra with peak FWHM
Definition: PeakPickerHiRes.h:650
const double k
virtual double getSignalToNoise(const PeakIterator &data_point)
Definition: SignalToNoiseEstimator.h:128
void setRT(CoordinateType rt)
Mutable access to RT.
Definition: ChromatogramPeak.h:122
Size getNrChromatograms() const
get the total number of chromatograms available
Definition: OnDiscMSExperiment.h:162
const std::vector< MSChromatogram > & getChromatograms() const
returns the chromatogram list
void pickExperiment(const PeakMap &input, PeakMap &output, const bool check_spectrum_type=true) const
Applies the peak-picking algorithm to a map (MSExperiment). This method picks peaks for each scan in ...
Definition: PeakPickerHiRes.h:498
void sortByPosition()
Lexicographically sorts the peaks by their position.
void pick(const MSChromatogram &input, MSChromatogram &output) const
Applies the peak-picking algorithm to a single chromatogram (MSChromatogram). The resulting picked pe...
Definition: PeakPickerHiRes.h:114
The representation of a chromatogram.
Definition: MSChromatogram.h:54
SpectrumType
Spectrum peak type.
Definition: SpectrumSettings.h:70
const String & getName() const
Returns the name.
void pickExperiment(const PeakMap &input, PeakMap &output, std::vector< std::vector< PeakBoundary > > &boundaries_spec, std::vector< std::vector< PeakBoundary > > &boundaries_chrom, const bool check_spectrum_type=true) const
Applies the peak-picking algorithm to a map (MSExperiment). This method picks peaks for each scan in ...
Definition: PeakPickerHiRes.h:516
void pickExperiment(OnDiscPeakMap &input, PeakMap &output, const bool check_spectrum_type=true) const
Applies the peak-picking algorithm to a map (MSExperiment). This method picks peaks for each scan in ...
Definition: PeakPickerHiRes.h:579
void setName(const String &name)
Sets the name.
void resize(Size s)
Definition: MSExperiment.h:132
void addChromatogram(const MSChromatogram &chromatogram)
adds a chromatogram to the list
Size size() const
Definition: MSExperiment.h:127
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
void setMZ(CoordinateType mz)
Mutable access to m/z.
Definition: Peak1D.h:119
void setIntensity(IntensityType intensity)
Mutable access to the data point intensity (height)
Definition: Peak1D.h:110
bool report_FWHM_as_ppm_
unit of &#39;FWHM&#39; float data array (can be absolute or ppm).
Definition: PeakPickerHiRes.h:653
void setParameters(const Param &param)
Sets the parameters.
void setName(const String &name)
Sets the name.
double spacing_difference_gap_
Definition: PeakPickerHiRes.h:638
const FloatDataArrays & getFloatDataArrays() const
Returns a const reference to the float meta data arrays.
void pick(const MSSpectrum &input, MSSpectrum &output, std::vector< PeakBoundary > &boundaries, bool check_spacings=true) const
Applies the peak-picking algorithm to a single spectrum (MSSpectrum). The resulting picked peaks are ...
Definition: PeakPickerHiRes.h:130
Size size() const
alias for getNrSpectra
Definition: OnDiscMSExperiment.h:144
unsigned missing_
Definition: PeakPickerHiRes.h:644
MSChromatogram getChromatogram(Size id)
returns a single chromatogram
Definition: OnDiscMSExperiment.h:204
Representation of a mass spectrometry experiment on disk.
Definition: OnDiscMSExperiment.h:68
void pick(const MSChromatogram &input, MSChromatogram &output, std::vector< PeakBoundary > &boundaries) const
Applies the peak-picking algorithm to a single chromatogram (MSChromatogram). The resulting picked pe...
Definition: PeakPickerHiRes.h:452
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
virtual void init(const PeakIterator &it_begin, const PeakIterator &it_end)
Set the start and endpoint of the raw data interval, for which signal to noise ratios will be estimat...
Definition: SignalToNoiseEstimator.h:109
A method or algorithm argument contains illegal values.
Definition: Exception.h:648
std::vector< Int > ms_levels_
Definition: PeakPickerHiRes.h:647
boost::shared_ptr< const ExperimentalSettings > getExperimentalSettings() const
returns the meta information of this experiment (const access)
Definition: OnDiscMSExperiment.h:168
double mz_min
Definition: PeakPickerHiRes.h:89
SpectrumType getType() const
returns the spectrum type (centroided (PEAKS) or profile data (RAW))
Size getNrSpectra() const
get the total number of spectra available
const FloatDataArrays & getFloatDataArrays() const
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:54
void setMSLevel(UInt ms_level)
Sets the MS level.
double derivatives(double x, unsigned order) const
evaluates derivative of spline at position x
void pick(const MSSpectrum &input, MSSpectrum &output) const
Applies the peak-picking algorithm to a single spectrum (MSSpectrum). The resulting picked peaks are ...
Definition: PeakPickerHiRes.h:101
void clear(bool clear_meta_data)
Clears all data and meta data.
void setRT(double rt)
Sets the absolute retention time (in seconds)
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
double signal_to_noise_
Definition: PeakPickerHiRes.h:635
Estimates the signal/noise (S/N) ratio of each data point in a scan by using the median (histogram ba...
Definition: SignalToNoiseEstimatorMedian.h:80
const String & getName() const
void setType(SpectrumType type)
sets the spectrum type
void setIntensity(IntensityType intensity)
Mutable access to the data point intensity (height)
Definition: ChromatogramPeak.h:113
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
void clear(bool clear_meta_data)
Clears all data and meta data.
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:54
UInt getMSLevel() const
Returns the MS level.
A 1-dimensional raw data point or peak for chromatograms.
Definition: ChromatogramPeak.h:54
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:91
double mz_max
Definition: PeakPickerHiRes.h:90
Size getNrSpectra() const
get the total number of spectra available
Definition: OnDiscMSExperiment.h:156
double eval(double x) const
evaluates the spline at position x
void clear(bool clear_meta_data)
Clears all data and meta data.
double getRT() const
cubic spline interpolation as described in R.L. Burden, J.D. Faires, Numerical Analysis, 4th ed. PWS-Kent, 1989, ISBN 0-53491-585-X, pp. 126-131.
Definition: CubicSpline2d.h:53
static bool contains(const std::vector< T > &container, const E &elem)
Checks whether the element elem is contained in the given container.
Definition: ListUtils.h:149
This class implements a fast peak-picking algorithm best suited for high resolution MS data (FT-ICR-M...
Definition: PeakPickerHiRes.h:75
centroid data or stick data
Definition: SpectrumSettings.h:73
structure for peak boundaries
Definition: PeakPickerHiRes.h:87
Description of the experimental settings.
Definition: ExperimentalSettings.h:58
double spacing_difference_
Definition: PeakPickerHiRes.h:641

OpenMS / TOPP release 2.3.0 Documentation generated on Wed Apr 18 2018 19:29:07 using doxygen 1.8.14