OpenMS  3.0.0
PeakIntegrator.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-2022.
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 // $Maintainer: Douglas McCloskey, Pasquale Domenico Colaianni $
32 // $Authors: Douglas McCloskey, Pasquale Domenico Colaianni $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 #include <OpenMS/config.h> // OPENMS_DLLAPI
45 
46 namespace OpenMS
47 {
72  class OPENMS_DLLAPI PeakIntegrator :
73  public DefaultParamHandler
74  {
75 public:
79  ~PeakIntegrator() override;
80 
84  struct PeakArea
86  {
90  double area = 0.0;
94  double height = 0.0;
98  double apex_pos = 0.0;
103  };
105 
109  struct PeakBackground
111  {
115  double area = 0.0;
119  double height = 0.0;
120  };
122 
127  struct PeakShapeMetrics
129  {
133  double width_at_5 = 0.0;
137  double width_at_10 = 0.0;
141  double width_at_50 = 0.0;
145  double start_position_at_5 = 0.0;
149  double start_position_at_10 = 0.0;
153  double start_position_at_50 = 0.0;
157  double end_position_at_5 = 0.0;
161  double end_position_at_10 = 0.0;
165  double end_position_at_50 = 0.0;
169  double total_width = 0.0;
183  double tailing_factor = 0.0;
193  double asymmetry_factor = 0.0;
198  double slope_of_baseline = 0.0;
203  double baseline_delta_2_height = 0.0;
207  Int points_across_baseline = 0;
211  Int points_across_half_height = 0;
212  };
214 
220  static constexpr const char* INTEGRATION_TYPE_INTENSITYSUM = "intensity_sum";
224  static constexpr const char* INTEGRATION_TYPE_TRAPEZOID = "trapezoid";
226  static constexpr const char* INTEGRATION_TYPE_SIMPSON = "simpson";
228  static constexpr const char* BASELINE_TYPE_BASETOBASE = "base_to_base";
230  static constexpr const char* BASELINE_TYPE_VERTICALDIVISION = "vertical_division";
232  static constexpr const char* BASELINE_TYPE_VERTICALDIVISION_MIN = "vertical_division_min";
234  static constexpr const char* BASELINE_TYPE_VERTICALDIVISION_MAX = "vertical_division_max";
236 
255  PeakArea integratePeak(
256  const MSChromatogram& chromatogram, const double left, const double right
257  ) const;
258 
277  PeakArea integratePeak(
279  ) const;
280 
299  PeakArea integratePeak(
300  const MSSpectrum& spectrum, const double left, const double right
301  ) const;
302 
321  PeakArea integratePeak(
322  const MSSpectrum& spectrum, MSSpectrum::ConstIterator& left, MSSpectrum::ConstIterator& right
323  ) const;
324 
349  PeakBackground estimateBackground(
350  const MSChromatogram& chromatogram, const double left, const double right,
351  const double peak_apex_pos
352  ) const;
353 
378  PeakBackground estimateBackground(
380  const double peak_apex_pos
381  ) const;
382 
407  PeakBackground estimateBackground(
408  const MSSpectrum& spectrum, const double left, const double right,
409  const double peak_apex_pos
410  ) const;
411 
436  PeakBackground estimateBackground(
437  const MSSpectrum& spectrum, MSSpectrum::ConstIterator& left, MSSpectrum::ConstIterator& right,
438  const double peak_apex_pos
439  ) const;
440 
460  PeakShapeMetrics calculatePeakShapeMetrics(
461  const MSChromatogram& chromatogram, const double left, const double right,
462  const double peak_height, const double peak_apex_pos
463  ) const;
464 
484  PeakShapeMetrics calculatePeakShapeMetrics(
486  const double peak_height, const double peak_apex_pos
487  ) const;
488 
508  PeakShapeMetrics calculatePeakShapeMetrics(
509  const MSSpectrum& spectrum, const double left, const double right,
510  const double peak_height, const double peak_apex_pos
511  ) const;
512 
532  PeakShapeMetrics calculatePeakShapeMetrics(
533  const MSSpectrum& spectrum, MSSpectrum::ConstIterator& left, MSSpectrum::ConstIterator& right,
534  const double peak_height, const double peak_apex_pos
535  ) const;
536 
537  void getDefaultParameters(Param& params);
538 
539 protected:
540  void updateMembers_() override;
541 
542  template <typename PeakContainerT>
543  PeakArea integratePeak_(const PeakContainerT& pc, double left, double right) const
544  {
545  OPENMS_PRECONDITION(left <= right, "Left peak boundary must be smaller than right boundary!") // otherwise the code below will segfault (due to PosBegin/PosEnd)
546  PeakContainerT emg_pc;
547  const PeakContainerT& p = EMGPreProcess_(pc, emg_pc, left, right);
548 
549  std::function<double(const double, const double)>
550  compute_peak_area_trapezoid = [&p](const double left, const double right)
551  {
552  double peak_area { 0.0 };
553  for (typename PeakContainerT::ConstIterator it = p.PosBegin(left); it != p.PosEnd(right) - 1; ++it)
554  {
555  peak_area += ((it + 1)->getPos() - it->getPos()) * ((it->getIntensity() + (it + 1)->getIntensity()) / 2.0);
556  }
557  return peak_area;
558  };
559 
560  std::function<double(const double, const double)>
561  compute_peak_area_intensity_sum = [&p](const double left, const double right)
562  {
563  // OPENMS_LOG_WARN << "WARNING: intensity_sum method is being used." << std::endl;
564  double peak_area { 0.0 };
565  for (typename PeakContainerT::ConstIterator it = p.PosBegin(left); it != p.PosEnd(right); ++it)
566  {
567  peak_area += it->getIntensity();
568  }
569  return peak_area;
570  };
571 
572  PeakArea pa;
573  pa.apex_pos = (left + right) / 2; // initial estimate, to avoid apex being outside of [left,right]
574  UInt n_points = std::distance(p.PosBegin(left), p.PosEnd(right));
575  for (auto it = p.PosBegin(left); it != p.PosEnd(right); ++it) //OMS_CODING_TEST_EXCLUDE
576  {
577  pa.hull_points.push_back(DPosition<2>(it->getPos(), it->getIntensity()));
578  if (pa.height < it->getIntensity())
579  {
580  pa.height = it->getIntensity();
581  pa.apex_pos = it->getPos();
582  }
583  }
584 
585  if (integration_type_ == INTEGRATION_TYPE_TRAPEZOID)
586  {
587  if (n_points >= 2)
588  {
589  pa.area = compute_peak_area_trapezoid(left, right);
590  }
591  }
592  else if (integration_type_ == INTEGRATION_TYPE_SIMPSON)
593  {
594  if (n_points == 2)
595  {
596  OPENMS_LOG_WARN << std::endl << "PeakIntegrator::integratePeak:"
597  "number of points is 2, falling back to `trapezoid`." << std::endl;
598  pa.area = compute_peak_area_trapezoid(left, right);
599  }
600  else if (n_points > 2)
601  {
602  if (n_points % 2)
603  {
604  pa.area = simpson_(p.PosBegin(left), p.PosEnd(right));
605  }
606  else
607  {
608  double areas[4] = {-1.0, -1.0, -1.0, -1.0};
609  areas[0] = simpson_(p.PosBegin(left), p.PosEnd(right) - 1); // without last point
610  areas[1] = simpson_(p.PosBegin(left) + 1, p.PosEnd(right)); // without first point
611  if (p.begin() <= p.PosBegin(left) - 1)
612  {
613  areas[2] = simpson_(p.PosBegin(left) - 1, p.PosEnd(right)); // with one more point on the left
614  }
615  if (p.PosEnd(right) < p.end())
616  {
617  areas[3] = simpson_(p.PosBegin(left), p.PosEnd(right) + 1); // with one more point on the right
618  }
619  UInt valids = 0;
620  for (const auto& area : areas)
621  {
622  if (area != -1.0)
623  {
624  pa.area += area;
625  ++valids;
626  }
627  }
628  pa.area /= valids;
629  }
630  }
631  }
632  else if (integration_type_ == INTEGRATION_TYPE_INTENSITYSUM)
633  {
634  pa.area = compute_peak_area_intensity_sum(left, right);
635  }
636  else
637  {
638  throw Exception::InvalidParameter(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Please set a valid value for the parameter \"integration_type\".");
639  }
640 
641  return pa;
642  }
643 
644 
645 
646  template <typename PeakContainerT>
648  const PeakContainerT& pc, double left, double right,
649  const double peak_apex_pos
650  ) const
651  {
652  PeakContainerT emg_pc;
653  const PeakContainerT& p = EMGPreProcess_(pc, emg_pc, left, right);
654 
655  const double int_l = p.PosBegin(left)->getIntensity();
656  const double int_r = (p.PosEnd(right) - 1)->getIntensity();
657  const double delta_int = int_r - int_l;
658  const double delta_pos = (p.PosEnd(right) - 1)->getPos() - p.PosBegin(left)->getPos();
659  const double min_int_pos = int_r <= int_l ? (p.PosEnd(right) - 1)->getPos() : p.PosBegin(left)->getPos();
660  const double delta_int_apex = std::fabs(delta_int) * std::fabs(min_int_pos - peak_apex_pos) / delta_pos;
661  double area {0.0};
662  double height {0.0};
663  if (baseline_type_ == BASELINE_TYPE_BASETOBASE)
664  {
665  height = std::min(int_r, int_l) + delta_int_apex;
666  if (integration_type_ == INTEGRATION_TYPE_TRAPEZOID || integration_type_ == INTEGRATION_TYPE_SIMPSON)
667  {
668  // formula for calculating the background using the trapezoidal rule
669  // area = intensity_min*delta_pos + 0.5*delta_int*delta_pos;
670  area = delta_pos * (std::min(int_r, int_l) + 0.5 * std::fabs(delta_int));
671  }
672  else if (integration_type_ == INTEGRATION_TYPE_INTENSITYSUM)
673  {
674  // calculate the background using an estimator of the form
675  // y = mx + b
676  // where x = rt or mz, m = slope, b = left intensity
677  // sign of delta_int will determine line direction
678  // area += delta_int / delta_pos * (it->getPos() - left) + int_l;
679  double pos_sum = 0.0; // rt or mz
680  for (auto it = p.PosBegin(left); it != p.PosEnd(right); ++it) //OMS_CODING_TEST_EXCLUDE
681  {
682  pos_sum += it->getPos();
683  }
684  UInt n_points = std::distance(p.PosBegin(left), p.PosEnd(right));
685 
686  // We construct the background area as the sum of a rectangular part
687  // and a triangle on top. The triangle is constructed as the sum of the
688  // line's y value at each sampled point: \sum_{i=0}^{n} (x_i - x_0) * m
689  const double rectangle_area = n_points * int_l;
690  const double slope = delta_int / delta_pos;
691  const double triangle_area = (pos_sum - n_points * p.PosBegin(left)->getPos()) * slope;
692  area = triangle_area + rectangle_area;
693  }
694  }
695  else if (baseline_type_ == BASELINE_TYPE_VERTICALDIVISION || baseline_type_ == BASELINE_TYPE_VERTICALDIVISION_MIN)
696  {
697  height = std::min(int_r, int_l);
698  if (integration_type_ == INTEGRATION_TYPE_TRAPEZOID || integration_type_ == INTEGRATION_TYPE_SIMPSON)
699  {
700  area = delta_pos * std::min(int_r, int_l);
701  }
702  else if (integration_type_ == INTEGRATION_TYPE_INTENSITYSUM)
703  {
704  area = std::min(int_r, int_l) * std::distance(p.PosBegin(left), p.PosEnd(right));;
705  }
706  }
707  else if (baseline_type_ == BASELINE_TYPE_VERTICALDIVISION_MAX)
708  {
709  height = std::max(int_r, int_l);
710  if (integration_type_ == INTEGRATION_TYPE_TRAPEZOID || integration_type_ == INTEGRATION_TYPE_SIMPSON)
711  {
712  area = delta_pos * std::max(int_r, int_l);
713  }
714  else if (integration_type_ == INTEGRATION_TYPE_INTENSITYSUM)
715  {
716  area = std::max(int_r, int_l) * std::distance(p.PosBegin(left), p.PosEnd(right));
717  }
718  }
719  else
720  {
721  throw Exception::InvalidParameter(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Please set a valid value for the parameter \"baseline_type\".");
722  }
723  PeakBackground pb;
724  pb.area = area;
725  pb.height = height;
726  return pb;
727  }
728 
743  template <typename PeakContainerConstIteratorT>
744  double simpson_(PeakContainerConstIteratorT it_begin, PeakContainerConstIteratorT it_end) const
745  {
746  double integral = 0.0;
747  for (auto it = it_begin + 1; it < it_end - 1; it = it + 2) //OMS_CODING_TEST_EXCLUDE
748  {
749  const double h = it->getPos() - (it - 1)->getPos();
750  const double k = (it + 1)->getPos() - it->getPos();
751  const double y_h = (it - 1)->getIntensity();
752  const double y_0 = it->getIntensity();
753  const double y_k = (it + 1)->getIntensity();
754  integral += (1.0 / 6.0) * (h + k) * ((2.0 - k / h) * y_h + (pow(h + k, 2) / (h * k)) * y_0 + (2.0 - h / k) * y_k);
755  }
756  return integral;
757  }
758 
759 
760  template <typename PeakContainerT>
762  const PeakContainerT& pc, double left, double right,
763  const double peak_height, const double peak_apex_pos
764  ) const
765  {
766  PeakShapeMetrics psm;
767 
768  if (pc.empty()) return psm; // return all '0'
769 
770  // enforce order: left <= peakapex <= right
771  if (!(left <= peak_apex_pos && peak_apex_pos <= right)) throw Exception::InvalidRange(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION);
772 
773  PeakContainerT emg_pc;
774  const PeakContainerT& p = EMGPreProcess_(pc, emg_pc, left, right);
775 
776  typename PeakContainerT::ConstIterator it_PosBegin_l = p.PosBegin(left);
777  typename PeakContainerT::ConstIterator it_PosEnd_apex = p.PosBegin(peak_apex_pos); // if peak_apex_pos is correct, this will get the underlying iterator
778  typename PeakContainerT::ConstIterator it_PosEnd_r = p.PosEnd(right); // past the end. Do not dereference (might be the true .end())
779  for (auto it = it_PosBegin_l; it != it_PosEnd_r; ++it) //OMS_CODING_TEST_EXCLUDE
780  {
781  // points across the peak
782  ++(psm.points_across_baseline);
783  if (it->getIntensity() >= 0.5 * peak_height)
784  {
786  }
787  }
788  // positions at peak heights
789  psm.start_position_at_5 = findPosAtPeakHeightPercent_(it_PosBegin_l, it_PosEnd_apex, p.end(), peak_height, 0.05, true);
790  psm.start_position_at_10 = findPosAtPeakHeightPercent_(it_PosBegin_l, it_PosEnd_apex, p.end(), peak_height, 0.1, true);
791  psm.start_position_at_50 = findPosAtPeakHeightPercent_(it_PosBegin_l, it_PosEnd_apex, p.end(), peak_height, 0.5, true);
792  psm.end_position_at_5 = findPosAtPeakHeightPercent_(it_PosEnd_apex, it_PosEnd_r, p.end(), peak_height, 0.05, false);
793  psm.end_position_at_10 = findPosAtPeakHeightPercent_(it_PosEnd_apex, it_PosEnd_r, p.end(), peak_height, 0.1, false);
794  psm.end_position_at_50 = findPosAtPeakHeightPercent_(it_PosEnd_apex, it_PosEnd_r, p.end(), peak_height, 0.5, false);
795  // peak widths
799  psm.total_width = (p.PosEnd(right) - 1)->getPos() - p.PosBegin(left)->getPos();
800  psm.slope_of_baseline = (p.PosEnd(right) - 1)->getIntensity() - p.PosBegin(left)->getIntensity();
801  psm.baseline_delta_2_height = psm.slope_of_baseline / peak_height;
802  // Source of tailing_factor and asymmetry_factor formulas:
803  // USP 40 - NF 35 The United States Pharmacopeia and National Formulary - Supplementary
804  psm.tailing_factor = psm.width_at_5 / (2*(peak_apex_pos - psm.start_position_at_5));
805  psm.asymmetry_factor = (psm.end_position_at_10 - peak_apex_pos) / (peak_apex_pos - psm.start_position_at_10);
806  return psm;
807  }
808 
809 
810 
831  template <typename PeakContainerConstIteratorT>
833  PeakContainerConstIteratorT it_left, // must not be past the end
834  PeakContainerConstIteratorT it_right, // might be past the end
835  PeakContainerConstIteratorT it_end, // definitely past-the-end
836  const double peak_height,
837  const double percent,
838  const bool is_left_half) const
839  {
840  // no points in range
841  if (it_left == it_end) throw Exception::InvalidRange(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION);
842 
843  // only one point in range
844  if (it_left == it_right) return it_left->getPos();
845 
846  const double percent_intensity = peak_height * percent;
847  PeakContainerConstIteratorT closest;
848  if (is_left_half)
849  {
850  closest = it_left;
851  for (
852  PeakContainerConstIteratorT it = it_left;
853  it < it_right && it->getIntensity() <= percent_intensity;
854  closest = it++
855  ) {}
856  }
857  else // right half; search from right to left
858  {
859  closest = it_right - 1; // make sure we can deference it
860  for (
861  PeakContainerConstIteratorT it = it_right - 1;
862  it >= it_left && it->getIntensity() <= percent_intensity;
863  closest = it--
864  ) {}
865  }
866  return closest->getPos();
867  }
868 
869 private:
874 
879  String integration_type_ = INTEGRATION_TYPE_INTENSITYSUM;
884  String baseline_type_ = BASELINE_TYPE_BASETOBASE;
886 
888  bool fit_EMG_;
890 
891 
905  template <typename PeakContainerT>
906  const PeakContainerT& EMGPreProcess_(
907  const PeakContainerT& pc,
908  PeakContainerT& emg_pc,
909  double& left,
910  double& right
911  ) const
912  {
913  if (fit_EMG_)
914  {
915  emg_.fitEMGPeakModel(pc, emg_pc, left, right);
916  left = emg_pc.front().getPos();
917  right = emg_pc.back().getPos();
918  return emg_pc;
919  }
920  return pc;
921  }
922  };
923 }
LogStream.h
DefaultParamHandler.h
OpenMS::PeakIntegrator
Compute the area, background and shape metrics of a peak.
Definition: PeakIntegrator.h:72
OpenMS::PeakIntegrator::PeakShapeMetrics::start_position_at_50
double start_position_at_50
Definition: PeakIntegrator.h:153
OpenMS::PeakIntegrator::PeakShapeMetrics::points_across_half_height
Int points_across_half_height
Definition: PeakIntegrator.h:211
double
EmgGradientDescent.h
OpenMS::PeakIntegrator::PeakArea::area
double area
Definition: PeakIntegrator.h:90
OpenMS::PeakIntegrator::PeakShapeMetrics::width_at_10
double width_at_10
Definition: PeakIntegrator.h:137
OpenMS::Constants::k
const double k
Definition: Constants.h:153
OpenMS::PeakIntegrator::PeakShapeMetrics::slope_of_baseline
double slope_of_baseline
Definition: PeakIntegrator.h:198
OpenMS::PeakIntegrator::estimateBackground_
PeakBackground estimateBackground_(const PeakContainerT &pc, double left, double right, const double peak_apex_pos) const
Definition: PeakIntegrator.h:647
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::PeakIntegrator::PeakShapeMetrics::baseline_delta_2_height
double baseline_delta_2_height
Definition: PeakIntegrator.h:203
OpenMS::Exception::InvalidRange
Invalid range exception.
Definition: Exception.h:276
OpenMS::PeakIntegrator::PeakShapeMetrics::tailing_factor
double tailing_factor
Definition: PeakIntegrator.h:183
OpenMS::EmgGradientDescent
Compute the area, background and shape metrics of a peak.
Definition: EmgGradientDescent.h:64
OpenMS::PeakIntegrator::PeakShapeMetrics::asymmetry_factor
double asymmetry_factor
Definition: PeakIntegrator.h:193
OpenMS::PeakIntegrator::PeakShapeMetrics::start_position_at_5
double start_position_at_5
Definition: PeakIntegrator.h:145
OPENMS_PRECONDITION
#define OPENMS_PRECONDITION(condition, message)
Precondition macro.
Definition: openms/include/OpenMS/CONCEPT/Macros.h:120
OpenMS::PeakIntegrator::PeakShapeMetrics::width_at_50
double width_at_50
Definition: PeakIntegrator.h:141
OpenMS::PeakIntegrator::PeakShapeMetrics
Definition: PeakIntegrator.h:128
OPENMS_LOG_WARN
#define OPENMS_LOG_WARN
Macro if a warning, a piece of information which should be read by the user, should be logged.
Definition: LogStream.h:460
OpenMS::PeakIntegrator::PeakShapeMetrics::end_position_at_5
double end_position_at_5
Definition: PeakIntegrator.h:157
OpenMS::PeakIntegrator::integratePeak_
PeakArea integratePeak_(const PeakContainerT &pc, double left, double right) const
Definition: PeakIntegrator.h:543
OpenMS::PeakIntegrator::PeakArea::hull_points
ConvexHull2D::PointArrayType hull_points
Definition: PeakIntegrator.h:102
OpenMS::PeakIntegrator::findPosAtPeakHeightPercent_
double findPosAtPeakHeightPercent_(PeakContainerConstIteratorT it_left, PeakContainerConstIteratorT it_right, PeakContainerConstIteratorT it_end, const double peak_height, const double percent, const bool is_left_half) const
Find the position (RT/MZ) at a given percentage of peak's height.
Definition: PeakIntegrator.h:832
OpenMS::PeakIntegrator::PeakShapeMetrics::total_width
double total_width
Definition: PeakIntegrator.h:169
OpenMS::PeakIntegrator::simpson_
double simpson_(PeakContainerConstIteratorT it_begin, PeakContainerConstIteratorT it_end) const
Simpson's rule algorithm.
Definition: PeakIntegrator.h:744
OpenMS::DefaultParamHandler
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
OpenMS::Exception::InvalidParameter
Exception indicating that an invalid parameter was handed over to an algorithm.
Definition: Exception.h:339
OpenMS::PeakIntegrator::PeakBackground
Definition: PeakIntegrator.h:110
OpenMS::ConvexHull2D::PointArrayType
std::vector< PointType > PointArrayType
Definition: ConvexHull2D.h:76
OpenMS::Int
int Int
Signed integer type.
Definition: Types.h:102
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::PeakIntegrator::fit_EMG_
bool fit_EMG_
Enable/disable EMG peak model fitting.
Definition: PeakIntegrator.h:888
OpenMS::PeakIntegrator::PeakShapeMetrics::start_position_at_10
double start_position_at_10
Definition: PeakIntegrator.h:149
OpenMS::PeakIntegrator::EMGPreProcess_
const PeakContainerT & EMGPreProcess_(const PeakContainerT &pc, PeakContainerT &emg_pc, double &left, double &right) const
Fit the peak to the EMG model.
Definition: PeakIntegrator.h:906
OpenMS::PeakIntegrator::PeakArea::apex_pos
double apex_pos
Definition: PeakIntegrator.h:98
ConvexHull2D.h
OpenMS::PeakIntegrator::PeakShapeMetrics::end_position_at_50
double end_position_at_50
Definition: PeakIntegrator.h:165
OpenMS::DPosition< 2 >
OpenMS::UInt
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
OpenMS::Constants::h
const double h
Definition: Constants.h:162
OpenMS::PeakIntegrator::calculatePeakShapeMetrics_
PeakShapeMetrics calculatePeakShapeMetrics_(const PeakContainerT &pc, double left, double right, const double peak_height, const double peak_apex_pos) const
Definition: PeakIntegrator.h:761
MSChromatogram.h
OpenMS::PeakIntegrator::PeakShapeMetrics::end_position_at_10
double end_position_at_10
Definition: PeakIntegrator.h:161
OpenMS::MSChromatogram
The representation of a chromatogram.
Definition: MSChromatogram.h:53
String.h
OpenMS::Param
Management and storage of parameters / INI files.
Definition: Param.h:69
OpenMS::PeakIntegrator::emg_
EmgGradientDescent emg_
Definition: PeakIntegrator.h:889
OpenMS::PeakIntegrator::PeakShapeMetrics::width_at_5
double width_at_5
Definition: PeakIntegrator.h:133
OpenMS::MSSpectrum::ConstIterator
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSSpectrum.h:130
OpenMS::MSChromatogram::ConstIterator
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSChromatogram.h:93
OpenMS::MSSpectrum
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
OpenMS::PeakIntegrator::PeakArea::height
double height
Definition: PeakIntegrator.h:94
MSSpectrum.h
OpenMS::PeakIntegrator::PeakShapeMetrics::points_across_baseline
Int points_across_baseline
Definition: PeakIntegrator.h:207
OpenMS::PeakIntegrator::PeakArea
Definition: PeakIntegrator.h:85
OpenMS::EmgGradientDescent::fitEMGPeakModel
void fitEMGPeakModel(const PeakContainerT &input_peak, PeakContainerT &output_peak, const double left_pos=0.0, const double right_pos=0.0) const
Fit the given peak (either MSChromatogram or MSSpectrum) to the EMG peak model.