OpenMS  2.6.0
MS2ConsensusSpectrum.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 // PEAK DETECTION OF FOURIER TRANSFORME MS INSTRUMENT DATA
38 //
39 // written by Markus Mueller, markus.mueller@imsb.biol.ethz.ch
40 // ( and Lukas Mueller, Lukas.Mueller@imsb.biol.ethz.ch)
41 // October 2005
42 //
43 // Ported to OpenMS by Florian Zeller, florian.zeller@bsse.ethz.ch
44 // December 2010
45 //
46 // Group of Prof. Ruedi Aebersold, IMSB, ETH Hoenggerberg, Zurich
47 //
48 //
49 
50 
51 #pragma once
52 
53 #include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/SUPERHIRN/SuperHirnConfig.h>
54 
55 #include <OpenMS/CONCEPT/Types.h>
57 
58 #include <string>
59 #include <map>
60 
61 namespace OpenMS
62 {
63 
64  class SUPERHIRN_DLLAPI MS2ConsensusSpectrum
65  {
66 
67 
69  // declaration of the private members:
70 
71 private:
72 
73  // stores the MS2 fragments:
74  std::multimap<double, MS2Fragment> MS2FragmentPeaks;
75 
76 
77 protected:
78 
80  // declaration of the public members:
81 
82 
83  double startTR;
84  double endTR;
85  int z;
86  int apexScan;
87  int startScan;
88  int endScan;
89 
90 
91 public:
92 
93  double precursorMZ;
94  double TR;
95 
96 
97  // mass to charge tolerance for MS2 trace level:
98  static double MS2_MZ_TOLERANCE;
99 
100  // class destructor
102 
103  // class constructor
106  MS2ConsensusSpectrum(double iPrecursorMZ, double iTR, int iChrg, int iApexScan);
107 
108  // class copy constructor
110  // class copy constructor
112 
113 
115  // overload operators:
116  MS2ConsensusSpectrum & operator=(const MS2ConsensusSpectrum &);
117  bool operator==(const MS2ConsensusSpectrum &);
118  MS2ConsensusSpectrum & operator<=(const MS2ConsensusSpectrum &);
119  MS2ConsensusSpectrum & operator>=(const MS2ConsensusSpectrum &);
121  MS2ConsensusSpectrum & operator>(const MS2ConsensusSpectrum &);
122 
123 
125  // compute the similarity of the elution shape of the
126  // MS2 fragment to this MS2 consensus spectrum
127  double getLCElutionPeakSimilarity(MS2Fragment *);
128 
129 
130  // add a MS2 fragment:
131  void addMS2Fragment(MS2Fragment *);
132 
133  // compute MS2 parameters
134  void computeMS2SpectrumParameters();
135 
136  //*** PK removed, never used
137 
138  // process the stored fragments:
139 // void processConsenusSpectraFragments();
140 
141  // remove outlier fragments based on their:
142  // MS2Fragment::OutlierAttribute = ...
143  // 1: retention time
144  // 2: precursor mass
145  // etc.
146 // void removeOutlierFragments();
147 
148  // remove H2O loss region of the MS2 spectra
149 // void removeWaterLossRegion( );
150 
151 
152  // show MS2 spectrum info:
153  void show_info();
154 
155 
156  // find a corresponding MS2 fragment
157  MS2Fragment * findMS2Fragment(double);
158 
159 
160 
162  // start here all the get / set
163  // function to access the
164  // variables of the class
165 
166  // precursor mass:
167  double getPrecursorMZ();
168 
169  // TR:
170  double getTR();
171  // start TR
172  double getStartTR();
173  // end TR
174  double getEndTR();
175 
176 
177  // set / get the charge state of the precursor MZ:
178  void setPrecursorChrg(int in);
179  int getPrecursorChrg();
180  // apex scan:
181  int getApexScan();
182  // start scan
183  int getStartScan();
184  // end scan
185  int getEndScan();
186  // get the number of consensus fragments:
187  int getNbMS2Fragments();
188 
189  // get the MS2 fragments list iterator:
190  std::multimap<double, MS2Fragment>::iterator getMS2FragmentPeakStart();
191  std::multimap<double, MS2Fragment>::iterator getMS2FragmentPeakEnd();
192  std::multimap<double, MS2Fragment> * getMS2FragmentMap();
193 
194  };
195 
196 } // ns
197 
OpenMS::MS2ConsensusSpectrum::TR
double TR
Definition: MS2ConsensusSpectrum.h:94
OpenMS::MS2ConsensusSpectrum::precursorMZ
double precursorMZ
Definition: MS2ConsensusSpectrum.h:93
Types.h
OpenMS::MS2ConsensusSpectrum::z
int z
Definition: MS2ConsensusSpectrum.h:85
OpenMS::operator<
bool operator<(const QTCluster &q1, const QTCluster &q2)
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::MS2ConsensusSpectrum
Definition: MS2ConsensusSpectrum.h:64
OpenMS::MS2ConsensusSpectrum::endScan
int endScan
Definition: MS2ConsensusSpectrum.h:88
OpenMS::MS2ConsensusSpectrum::MS2FragmentPeaks
std::multimap< double, MS2Fragment > MS2FragmentPeaks
Definition: MS2ConsensusSpectrum.h:74
OpenMS::MS2ConsensusSpectrum::apexScan
int apexScan
Definition: MS2ConsensusSpectrum.h:86
OpenMS::MS2ConsensusSpectrum::MS2_MZ_TOLERANCE
static double MS2_MZ_TOLERANCE
Definition: MS2ConsensusSpectrum.h:98
OpenMS::MS2Fragment
Definition: MS2Fragment.h:60
OpenMS::MS2ConsensusSpectrum::startTR
double startTR
Definition: MS2ConsensusSpectrum.h:83
MS2Fragment.h
OpenMS::Internal::operator==
bool operator==(const IDBoostGraph::ProteinGroup &lhs, const IDBoostGraph::ProteinGroup &rhs)
OpenMS::MS2ConsensusSpectrum::startScan
int startScan
Definition: MS2ConsensusSpectrum.h:87
OpenMS::MS2ConsensusSpectrum::endTR
double endTR
Definition: MS2ConsensusSpectrum.h:84