OpenMS  2.6.0
MS1FeatureMerger.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-2020.
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: Timo Sachsenberg $
32 // $Authors: Lukas Mueller, Markus Mueller $
33 // --------------------------------------------------------------------------
34 //
36 //
37 // written by Lukas N Mueller, 30.3.05
38 // Lukas.Mueller@imsb.biol.ethz.ch
39 // Group of Prof. Ruedi Aebersold, IMSB, ETH Hoenggerberg, Zurich
40 //
41 // Ported to OpenMS by Florian Zeller, florian.zeller@bsse.ethz.ch
42 // December 2010
43 //
44 // **********************************************************************//
45 // CLASS Spec MERGER:
46 // merges 2 spectra which have been preprocessed
47 // by spec_merge-> common lc_peaks are marked!!!!
48 //
49 
50 #pragma once
51 
52 #include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/SUPERHIRN/SuperHirnConfig.h>
53 
54 #include <vector>
55 #include <map>
56 
57 namespace OpenMS
58 {
59  class LCMS;
60  class SHFeature;
61 
62  class SUPERHIRN_DLLAPI MS1FeatureMerger
63  {
64 
65 
67  // declaration of the private members:
68 
69 private:
70 
72  // the common lc-ms spectrum,
73  // created from the overlap of A and B
75 
76  std::vector<int> idsToRemove;
77  std::map<double, std::vector<SHFeature *> > mzClusters;
78 
79 
81  // declaration of the public members:
82 
83 public:
84 
85  /*
86  static double INTENSITY_APEX_THRESHOLD;
87  static double MS1_PEAK_AREA_TR_RESOLUTION;
88 
89  static double INITIAL_TR_TOLERANCE;
90  static double MS1_FEATURE_MERGING_TR_TOLERANCE;
91  static double PERCENTAGE_INTENSITY_ELUTION_BORDER_VARIATION;
92  static double PPM_TOLERANCE_FOR_MZ_CLUSTERING;
93  static bool MS1_FEATURE_CLUSTERING;
94  */
95 
96  // class destructor
98  // class constructor
100 
101 
103  // start the merging process
104  void startFeatureMerging();
105  // create a distribution of delta Tr for the split features
106  void createMZFeatureClusters();
107  // process a vector of m/z features
108  void processMZFeatureVector(std::vector<SHFeature *> *);
109  // find to this feature the features which should be merged
110  std::vector<SHFeature *>::iterator findFeaturesToMerge(SHFeature *, std::vector<SHFeature *>::iterator, std::vector<SHFeature *> *);
111  // compare if a feature belongs to another feature
112  bool compareMZFeatureBeloning(SHFeature *, SHFeature *);
113  // merge the target to the search feature
114  void mergeFeatures(SHFeature *, SHFeature *);
115  // compute new parameters for the merged MS1 feature
116  void computeNewMS1FeatureParameters(SHFeature *);
117  // computes the area of between 2 peaks:
118  double computeDeltaArea(double, double, double, double);
119 
120 
121  // this structure provides the function to compare
122  // in the sorting algorithm:
124  {
125  // provide the compare function for sort:
126  bool operator()(const SHFeature A, const SHFeature B) const;
127  };
128  };
129 
130 } // ns
131 
OpenMS::MS1FeatureMerger::idsToRemove
std::vector< int > idsToRemove
Definition: MS1FeatureMerger.h:76
OpenMS::SHFeature
Definition: SHFeature.h:59
OpenMS::MS1FeatureMerger::OPERATOR_FEATURE_TR
Definition: MS1FeatureMerger.h:123
OpenMS::MS1FeatureMerger::lcmsMap
LCMS * lcmsMap
Definition: MS1FeatureMerger.h:74
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::MS1FeatureMerger
Definition: MS1FeatureMerger.h:62
OpenMS::MS1FeatureMerger::mzClusters
std::map< double, std::vector< SHFeature * > > mzClusters
Definition: MS1FeatureMerger.h:77
OpenMS::LCMS
Definition: LCMS.h:57