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 #ifndef OPENMS_TRANSFORMATIONS_RAW2PEAK_PEAKPICKERHIRES_H
36 #define OPENMS_TRANSFORMATIONS_RAW2PEAK_PEAKPICKERHIRES_H
37 
44 
46 
47 
48 #define DEBUG_PEAK_PICKING
49 #undef DEBUG_PEAK_PICKING
50 //#undef DEBUG_DECONV
51 namespace OpenMS
52 {
76  class OPENMS_DLLAPI PeakPickerHiRes :
77  public DefaultParamHandler,
78  public ProgressLogger
79  {
80 public:
83 
85  virtual ~PeakPickerHiRes();
86 
88  struct PeakBoundary
89  {
90  double mz_min;
91  double mz_max;
92  };
93 
102  void pick(const MSSpectrum& input, MSSpectrum& output) const
103  {
104  std::vector<PeakBoundary> boundaries;
105  pick(input, output, boundaries);
106  }
107 
115  void pick(const MSChromatogram& input, MSChromatogram& output) const
116  {
117  std::vector<PeakBoundary> boundaries;
118  pick(input, output, boundaries);
119  }
120 
131  void pick(const MSSpectrum& input, MSSpectrum& output, std::vector<PeakBoundary>& boundaries, bool check_spacings = true) const
132  {
133  // copy meta data of the input spectrum
134  output.clear(true);
135  output.SpectrumSettings::operator=(input);
136  output.MetaInfoInterface::operator=(input);
137  output.setRT(input.getRT());
138  output.setMSLevel(input.getMSLevel());
139  output.setName(input.getName());
141  if (report_FWHM_)
142  {
143  output.getFloatDataArrays().resize(1);
144  output.getFloatDataArrays()[0].setName( report_FWHM_as_ppm_ ? "FWHM_ppm" : "FWHM");
145  }
146 
147  // don't pick a spectrum with less than 5 data points
148  if (input.size() < 5) return;
149 
150  // if both spacing constraints are disabled, don't check spacings at all:
151  if ((spacing_difference_ == std::numeric_limits<double>::infinity()) &&
152  (spacing_difference_gap_ == std::numeric_limits<double>::infinity()))
153  {
154  check_spacings = false;
155  }
156 
157  // signal-to-noise estimation
159  snt.setParameters(param_.copy("SignalToNoise:", true));
160 
161  if (signal_to_noise_ > 0.0)
162  {
163  snt.init(input);
164  }
165 
166  // find local maxima in raw data
167  for (Size i = 2; i < input.size() - 2; ++i)
168  {
169  double central_peak_mz = input[i].getMZ(), central_peak_int = input[i].getIntensity();
170  double left_neighbor_mz = input[i - 1].getMZ(), left_neighbor_int = input[i - 1].getIntensity();
171  double right_neighbor_mz = input[i + 1].getMZ(), right_neighbor_int = input[i + 1].getIntensity();
172 
173  // do not interpolate when the left or right support is a zero-data-point
174  if (std::fabs(left_neighbor_int) < std::numeric_limits<double>::epsilon()) continue;
175  if (std::fabs(right_neighbor_int) < std::numeric_limits<double>::epsilon()) continue;
176 
177  // MZ spacing sanity checks
178  double left_to_central = 0.0, central_to_right = 0.0, min_spacing = 0.0;
179  if (check_spacings)
180  {
181  left_to_central = central_peak_mz - left_neighbor_mz;
182  central_to_right = right_neighbor_mz - central_peak_mz;
183  min_spacing = (left_to_central < central_to_right) ? left_to_central : central_to_right;
184  }
185 
186  double act_snt = 0.0, act_snt_l1 = 0.0, act_snt_r1 = 0.0;
187  if (signal_to_noise_ > 0.0)
188  {
189  act_snt = snt.getSignalToNoise(input[i]);
190  act_snt_l1 = snt.getSignalToNoise(input[i - 1]);
191  act_snt_r1 = snt.getSignalToNoise(input[i + 1]);
192  }
193 
194  // look for peak cores meeting MZ and intensity/SNT criteria
195  if ((central_peak_int > left_neighbor_int) &&
196  (central_peak_int > right_neighbor_int) &&
197  (act_snt >= signal_to_noise_) &&
198  (act_snt_l1 >= signal_to_noise_) &&
199  (act_snt_r1 >= signal_to_noise_) &&
200  (!check_spacings ||
201  ((left_to_central < spacing_difference_ * min_spacing) &&
202  (central_to_right < spacing_difference_ * min_spacing))))
203  {
204  // special case: if a peak core is surrounded by more intense
205  // satellite peaks (indicates oscillation rather than
206  // real peaks) -> remove
207 
208  double act_snt_l2 = 0.0, act_snt_r2 = 0.0;
209 
210  if (signal_to_noise_ > 0.0)
211  {
212  act_snt_l2 = snt.getSignalToNoise(input[i - 2]);
213  act_snt_r2 = snt.getSignalToNoise(input[i + 2]);
214  }
215 
216  // checking signal-to-noise?
217  if ((i > 1) &&
218  (i + 2 < input.size()) &&
219  (left_neighbor_int < input[i - 2].getIntensity()) &&
220  (right_neighbor_int < input[i + 2].getIntensity()) &&
221  (act_snt_l2 >= signal_to_noise_) &&
222  (act_snt_r2 >= signal_to_noise_) &&
223  (!check_spacings ||
224  ((left_neighbor_mz - input[i - 2].getMZ() < spacing_difference_ * min_spacing) &&
225  (input[i + 2].getMZ() - right_neighbor_mz < spacing_difference_ * min_spacing))))
226  {
227  ++i;
228  continue;
229  }
230 
231  std::map<double, double> peak_raw_data;
232 
233  peak_raw_data[central_peak_mz] = central_peak_int;
234  peak_raw_data[left_neighbor_mz] = left_neighbor_int;
235  peak_raw_data[right_neighbor_mz] = right_neighbor_int;
236 
237  // peak core found, now extend it
238  // to the left
239  Size k = 2;
240 
241  bool previous_zero_left(false); // no need to extend peak if previous intensity was zero
242  Size missing_left(0);
243  Size left_boundary(i - 1); // index of the left boundary for the spline interpolation
244 
245  while ((k <= i) && // prevent underflow
246  (i - k + 1 > 0) &&
247  !previous_zero_left &&
248  (missing_left <= missing_) &&
249  (input[i - k].getIntensity() <= peak_raw_data.begin()->second) &&
250  (!check_spacings ||
251  (peak_raw_data.begin()->first - input[i - k].getMZ() < spacing_difference_gap_ * min_spacing)))
252  {
253  double act_snt_lk = 0.0;
254 
255  if (signal_to_noise_ > 0.0)
256  {
257  act_snt_lk = snt.getSignalToNoise(input[i - k]);
258  }
259 
260  if ((act_snt_lk >= signal_to_noise_) &&
261  (!check_spacings ||
262  (peak_raw_data.begin()->first - input[i - k].getMZ() < spacing_difference_ * min_spacing)))
263  {
264  peak_raw_data[input[i - k].getMZ()] = input[i - k].getIntensity();
265  }
266  else
267  {
268  ++missing_left;
269  if (missing_left <= missing_)
270  {
271  peak_raw_data[input[i - k].getMZ()] = input[i - k].getIntensity();
272  }
273  }
274 
275  previous_zero_left = (input[i - k].getIntensity() == 0);
276  left_boundary = i - k;
277  ++k;
278  }
279 
280  // to the right
281  k = 2;
282 
283  bool previous_zero_right(false); // no need to extend peak if previous intensity was zero
284  Size missing_right(0);
285  Size right_boundary(i+1); // index of the right boundary for the spline interpolation
286 
287  while ((i + k < input.size()) &&
288  !previous_zero_right &&
289  (missing_right <= missing_) &&
290  (input[i + k].getIntensity() <= peak_raw_data.rbegin()->second) &&
291  (!check_spacings ||
292  (input[i + k].getMZ() - peak_raw_data.rbegin()->first < spacing_difference_gap_ * min_spacing)))
293  {
294  double act_snt_rk = 0.0;
295 
296  if (signal_to_noise_ > 0.0)
297  {
298  act_snt_rk = snt.getSignalToNoise(input[i + k]);
299  }
300 
301  if ((act_snt_rk >= signal_to_noise_) &&
302  (!check_spacings ||
303  (input[i + k].getMZ() - peak_raw_data.rbegin()->first < spacing_difference_ * min_spacing)))
304  {
305  peak_raw_data[input[i + k].getMZ()] = input[i + k].getIntensity();
306  }
307  else
308  {
309  ++missing_right;
310  if (missing_right <= missing_)
311  {
312  peak_raw_data[input[i + k].getMZ()] = input[i + k].getIntensity();
313  }
314  }
315 
316  previous_zero_right = (input[i + k].getIntensity() == 0);
317  right_boundary = i + k;
318  ++k;
319  }
320 
321  // skip if the minimal number of 3 points for fitting is not reached
322  if (peak_raw_data.size() < 3) continue;
323 
324  CubicSpline2d peak_spline (peak_raw_data);
325 
326  // calculate maximum by evaluating the spline's 1st derivative
327  // (bisection method)
328  double max_peak_mz = central_peak_mz;
329  double max_peak_int = central_peak_int;
330  double threshold = 0.000001;
331  double lefthand = left_neighbor_mz;
332  double righthand = right_neighbor_mz;
333 
334  bool lefthand_sign = 1;
335  double eps = std::numeric_limits<double>::epsilon();
336 
337  // bisection
338  do
339  {
340  double mid = (lefthand + righthand) / 2.0;
341  double midpoint_deriv_val = peak_spline.derivatives(mid, 1);
342 
343  // if deriv nearly zero then maximum already found
344  if (!(std::fabs(midpoint_deriv_val) > eps))
345  {
346  break;
347  }
348 
349  bool midpoint_sign = (midpoint_deriv_val < 0.0) ? 0 : 1;
350 
351  if (lefthand_sign ^ midpoint_sign)
352  {
353  righthand = mid;
354  }
355  else
356  {
357  lefthand = mid;
358  }
359  }
360  while (righthand - lefthand > threshold);
361 
362  max_peak_mz = (lefthand + righthand) / 2;
363  max_peak_int = peak_spline.eval(max_peak_mz);
364 
365  //
366  // compute FWHM
367  //
368  if (report_FWHM_)
369  {
370  double fwhm_int = max_peak_int / 2.0;
371  threshold = 0.01 * fwhm_int;
372  double mz_mid, int_mid;
373  // left:
374  double mz_left = peak_raw_data.begin()->first;
375  double mz_center = max_peak_mz;
376  if (peak_spline.eval(mz_left) > fwhm_int)
377  { // the spline ends before half max is reached -- take the leftmost point (probably an underestimation)
378  mz_mid = mz_left;
379  } else
380  {
381  do
382  {
383  mz_mid = mz_left / 2 + mz_center / 2;
384  int_mid = peak_spline.eval(mz_mid);
385  if (int_mid < fwhm_int)
386  {
387  mz_left = mz_mid;
388  }
389  else
390  {
391  mz_center = mz_mid;
392  }
393  } while(fabs(int_mid - fwhm_int) > threshold);
394  }
395  const double fwhm_left_mz = mz_mid;
396 
397  // right ...
398  double mz_right = peak_raw_data.rbegin()->first;
399  mz_center = max_peak_mz;
400  if (peak_spline.eval(mz_right) > fwhm_int)
401  { // the spline ends before half max is reached -- take the rightmost point (probably an underestimation)
402  mz_mid = mz_right;
403  } else
404  {
405  do
406  {
407  mz_mid = mz_right / 2 + mz_center / 2;
408  int_mid = peak_spline.eval(mz_mid);
409  if (int_mid < fwhm_int)
410  {
411  mz_right = mz_mid;
412  }
413  else
414  {
415  mz_center = mz_mid;
416  }
417 
418  } while(fabs(int_mid - fwhm_int) > threshold);
419  }
420  const double fwhm_right_mz = mz_mid;
421  const double fwhm_absolute = fwhm_right_mz - fwhm_left_mz;
422  output.getFloatDataArrays()[0].push_back( report_FWHM_as_ppm_ ? fwhm_absolute / max_peak_mz * 1e6 : fwhm_absolute);
423  } // FWHM
424 
425  // save picked peak into output spectrum
426  Peak1D peak;
427  PeakBoundary peak_boundary;
428  peak.setMZ(max_peak_mz);
429  peak.setIntensity(max_peak_int);
430  peak_boundary.mz_min = input[left_boundary].getMZ();
431  peak_boundary.mz_max = input[right_boundary].getMZ();
432  output.push_back(peak);
433 
434  boundaries.push_back(peak_boundary);
435 
436  // jump over raw data points that have been considered already
437  i = i + k - 1;
438  }
439  }
440 
441  return;
442  }
443 
444 
453  void pick(const MSChromatogram& input, MSChromatogram& output, std::vector<PeakBoundary>& boundaries) const
454  {
455  // copy meta data of the input chromatogram
456  output.clear(true);
457  output.ChromatogramSettings::operator=(input);
458  output.MetaInfoInterface::operator=(input);
459  output.setName(input.getName());
460 
461  MSSpectrum input_spectrum;
462  MSSpectrum output_spectrum;
463  for (MSChromatogram::const_iterator it = input.begin(); it != input.end(); ++it)
464  {
465  Peak1D p;
466  p.setMZ(it->getRT());
467  p.setIntensity(it->getIntensity());
468  input_spectrum.push_back(p);
469  }
470 
471  pick(input_spectrum, output_spectrum, boundaries, false); // no spacing checks!
472 
473  for (MSSpectrum::const_iterator it = output_spectrum.begin(); it != output_spectrum.end(); ++it)
474  {
476  p.setRT(it->getMZ());
477  p.setIntensity(it->getIntensity());
478  output.push_back(p);
479  }
480 
481  // copy float data arrays (for FWHM)
482  output.getFloatDataArrays().resize(output_spectrum.getFloatDataArrays().size());
483  for (Size i = 0; i < output_spectrum.getFloatDataArrays().size(); ++i)
484  {
485  output.getFloatDataArrays()[i].insert(output.getFloatDataArrays()[i].begin(), output_spectrum.getFloatDataArrays()[i].begin(), output_spectrum.getFloatDataArrays()[i].end());
486  output.getFloatDataArrays()[i].setName(output_spectrum.getFloatDataArrays()[i].getName());
487  }
488  }
489 
499  void pickExperiment(const PeakMap& input, PeakMap& output, const bool check_spectrum_type = true) const
500  {
501  std::vector<std::vector<PeakBoundary> > boundaries_spec;
502  std::vector<std::vector<PeakBoundary> > boundaries_chrom;
503  pickExperiment(input, output, boundaries_spec, boundaries_chrom, check_spectrum_type);
504  }
505 
517  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
518  {
519  // make sure that output is clear
520  output.clear(true);
521 
522  // copy experimental settings
523  static_cast<ExperimentalSettings &>(output) = input;
524 
525  // resize output with respect to input
526  output.resize(input.size());
527 
528  Size progress = 0;
529  startProgress(0, input.size() + input.getChromatograms().size(), "picking peaks");
530 
531  if (input.getNrSpectra() > 0)
532  {
533  for (Size scan_idx = 0; scan_idx != input.size(); ++scan_idx)
534  {
535  if (!ListUtils::contains(ms_levels_, input[scan_idx].getMSLevel()))
536  {
537  output[scan_idx] = input[scan_idx];
538  }
539  else
540  {
541  std::vector<PeakBoundary> boundaries_s; // peak boundaries of a single spectrum
542 
543  // determine type of spectral data (profile or centroided)
544  SpectrumSettings::SpectrumType spectrum_type = input[scan_idx].getType();
545 
546  if (spectrum_type == SpectrumSettings::PEAKS && check_spectrum_type)
547  {
548  throw OpenMS::Exception::IllegalArgument(__FILE__, __LINE__, __FUNCTION__, "Error: Centroided data provided but profile spectra expected.");
549  }
550 
551  pick(input[scan_idx], output[scan_idx], boundaries_s);
552  boundaries_spec.push_back(boundaries_s);
553  }
554  setProgress(++progress);
555  }
556  }
557 
558 
559  for (Size i = 0; i < input.getChromatograms().size(); ++i)
560  {
561  MSChromatogram chromatogram;
562  std::vector<PeakBoundary> boundaries_c; // peak boundaries of a single chromatogram
563  pick(input.getChromatograms()[i], chromatogram, boundaries_c);
564  output.addChromatogram(chromatogram);
565  boundaries_chrom.push_back(boundaries_c);
566  setProgress(++progress);
567  }
568  endProgress();
569 
570  return;
571  }
572 
580  void pickExperiment(/* const */ OnDiscPeakMap& input, PeakMap& output, const bool check_spectrum_type = true) const
581  {
582  // make sure that output is clear
583  output.clear(true);
584 
585  // copy experimental settings
586  static_cast<ExperimentalSettings &>(output) = *input.getExperimentalSettings();
587 
588  Size progress = 0;
589  startProgress(0, input.size() + input.getNrChromatograms(), "picking peaks");
590 
591  if (input.getNrSpectra() > 0)
592  {
593 
594  // resize output with respect to input
595  output.resize(input.size());
596 
597  for (Size scan_idx = 0; scan_idx != input.size(); ++scan_idx)
598  {
599  if (!ListUtils::contains(ms_levels_, input[scan_idx].getMSLevel()))
600  {
601  output[scan_idx] = input[scan_idx];
602  }
603  else
604  {
605  MSSpectrum s = input[scan_idx];
606  s.sortByPosition();
607 
608  // determine type of spectral data (profile or centroided)
609  SpectrumSettings::SpectrumType spectrum_type = s.getType();
610 
611  if (spectrum_type == SpectrumSettings::PEAKS && check_spectrum_type)
612  {
613  throw OpenMS::Exception::IllegalArgument(__FILE__, __LINE__, __FUNCTION__, "Error: Centroided data provided but profile spectra expected.");
614  }
615 
616  pick(s, output[scan_idx]);
617  }
618  setProgress(++progress);
619  }
620  }
621 
622  for (Size i = 0; i < input.getNrChromatograms(); ++i)
623  {
624  MSChromatogram chromatogram;
625  pick(input.getChromatogram(i), chromatogram);
626  output.addChromatogram(chromatogram);
627  setProgress(++progress);
628  }
629  endProgress();
630 
631  return;
632  }
633 
634 protected:
635  // signal-to-noise parameter
637 
638  // maximal spacing difference defining a large gap
640 
641  // maximal spacing difference defining a missing data point
643 
644  // maximum number of missing points
645  unsigned missing_;
646 
647  // MS levels to which peak picking is applied
648  std::vector<Int> ms_levels_;
649 
652 
655 
656  // docu in base class
657  void updateMembers_();
658 
659  }; // end PeakPickerHiRes
660 
661 } // namespace OpenMS
662 
663 #endif
bool report_FWHM_
add floatDataArray &#39;FWHM&#39;/&#39;FWHM_ppm&#39; to spectra with peak FWHM
Definition: PeakPickerHiRes.h:651
const double k
virtual double getSignalToNoise(const PeakIterator &data_point)
Definition: SignalToNoiseEstimator.h:129
void setRT(CoordinateType rt)
Mutable access to RT.
Definition: ChromatogramPeak.h:117
Size getNrChromatograms() const
get the total number of chromatograms available
Definition: OnDiscMSExperiment.h:163
const std::vector< MSChromatogram > & getChromatograms() const
returns the chromatogram list
Definition: MSExperiment.h:861
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:499
void sortByPosition()
Lexicographically sorts the peaks by their position.
Peak data (also called centroided data or stick data)
Definition: SpectrumSettings.h:74
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:115
The representation of a chromatogram.
Definition: MSChromatogram.h:55
SpectrumType
Spectrum peak type.
Definition: SpectrumSettings.h:71
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:517
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:580
void setName(const String &name)
Sets the name.
void resize(Size s)
Definition: MSExperiment.h:137
void addChromatogram(const MSChromatogram &chromatogram)
adds a chromatogram to the list
Definition: MSExperiment.h:855
Size size() const
Definition: MSExperiment.h:132
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
void setMZ(CoordinateType mz)
Mutable access to m/z.
Definition: Peak1D.h:120
void setIntensity(IntensityType intensity)
Mutable access to the data point intensity (height)
Definition: Peak1D.h:111
bool report_FWHM_as_ppm_
unit of &#39;FWHM&#39; float data array (can be absolute or ppm).
Definition: PeakPickerHiRes.h:654
void setParameters(const Param &param)
Sets the parameters.
void setName(const String &name)
Sets the name.
double spacing_difference_gap_
Definition: PeakPickerHiRes.h:639
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:131
Size size() const
alias for getNrSpectra
Definition: OnDiscMSExperiment.h:145
unsigned missing_
Definition: PeakPickerHiRes.h:645
MSChromatogram getChromatogram(Size id)
returns a single chromatogram
Definition: OnDiscMSExperiment.h:217
Representation of a mass spectrometry experiment on disk.
Definition: OnDiscMSExperiment.h:69
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:453
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
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:110
A method or algorithm argument contains illegal values.
Definition: Exception.h:649
std::vector< Int > ms_levels_
Definition: PeakPickerHiRes.h:648
boost::shared_ptr< const ExperimentalSettings > getExperimentalSettings() const
returns the meta information of this experiment (const access)
Definition: OnDiscMSExperiment.h:169
double mz_min
Definition: PeakPickerHiRes.h:90
SpectrumType getType() const
returns the spectrum type
Size getNrSpectra() const
get the total number of spectra available
Definition: MSExperiment.h:887
const FloatDataArrays & getFloatDataArrays() const
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:55
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:102
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:82
double signal_to_noise_
Definition: PeakPickerHiRes.h:636
Estimates the signal/noise (S/N) ratio of each data point in a scan by using the median (histogram ba...
Definition: SignalToNoiseEstimatorMedian.h:81
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:108
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
void clear(bool clear_meta_data)
Clears all data and meta data.
Definition: MSExperiment.h:929
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:55
UInt getMSLevel() const
Returns the MS level.
A 1-dimensional raw data point or peak for chromatograms.
Definition: ChromatogramPeak.h:55
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
double mz_max
Definition: PeakPickerHiRes.h:91
Size getNrSpectra() const
get the total number of spectra available
Definition: OnDiscMSExperiment.h:157
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:59
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:150
This class implements a fast peak-picking algorithm best suited for high resolution MS data (FT-ICR-M...
Definition: PeakPickerHiRes.h:76
structure for peak boundaries
Definition: PeakPickerHiRes.h:88
Description of the experimental settings.
Definition: ExperimentalSettings.h:59
double spacing_difference_
Definition: PeakPickerHiRes.h:642

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:03 using doxygen 1.8.13