Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
MetaboliteSpectralMatching.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-2015.
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: Erhan Kenar $
32 // $Authors: Erhan Kenar $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_ANALYSIS_ID_METABOLITESPECTRALMATCHING_H
36 #define OPENMS_ANALYSIS_ID_METABOLITESPECTRALMATCHING_H
37 
39 #include <OpenMS/KERNEL/Feature.h>
41 #include <OpenMS/FORMAT/MzTab.h>
47 
48 
49 #include <vector>
50 #include <algorithm>
51 
52 namespace OpenMS
53 {
54 
55  struct OPENMS_DLLAPI PrecursorMassComparator
56  {
57  bool operator() (const MSSpectrum<Peak1D>& a, const MSSpectrum<Peak1D>& b)
58  {
59  return a.getPrecursors()[0].getMZ() < b.getPrecursors()[0].getMZ();
60  }
61 
63 
64  class OPENMS_DLLAPI SpectralMatch
65  {
66  public:
68  SpectralMatch();
69 
71  ~SpectralMatch();
72 
75 
77  SpectralMatch& operator=(const SpectralMatch&);
78 
79  double getObservedPrecursorMass() const;
80  void setObservedPrecursorMass(const double&);
81 
82  double getObservedPrecursorRT() const;
83  void setObservedPrecursorRT(const double&);
84 
85  double getFoundPrecursorMass() const;
86  void setFoundPrecursorMass(const double&);
87 
88  Int getFoundPrecursorCharge() const;
89  void setFoundPrecursorCharge(const Int&);
90 
91  double getMatchingScore() const;
92  void setMatchingScore(const double&);
93 
94  Size getObservedSpectrumIndex() const;
95  void setObservedSpectrumIndex(const Size&);
96 
97  Size getMatchingSpectrumIndex() const;
98  void setMatchingSpectrumIndex(const Size&);
99 
100  String getPrimaryIdentifier() const;
101  void setPrimaryIdentifier(const String&);
102 
103  String getSecondaryIdentifier() const;
104  void setSecondaryIdentifier(const String&);
105 
106  String getCommonName() const;
107  void setCommonName(const String&);
108 
109  String getSumFormula() const;
110  void setSumFormula(const String&);
111 
112  String getInchiString() const;
113  void setInchiString(const String&);
114 
115  String getSMILESString() const;
116  void setSMILESString(const String&);
117 
118  String getPrecursorAdduct() const;
119  void setPrecursorAdduct(const String&);
120 
121 
122  private:
130 
131  // further meta information
139 
140  };
141 
142  struct OPENMS_DLLAPI SpectralMatchScoreComparator
143  {
144  bool operator() (const SpectralMatch& a, const SpectralMatch& b)
145  {
146  return a.getMatchingScore() > b.getMatchingScore();
147  }
148 
150 
151 
152 
153 
154  class OPENMS_DLLAPI MetaboliteSpectralMatching :
155  public DefaultParamHandler,
156  public ProgressLogger
157  {
158  public:
161 
163  virtual ~MetaboliteSpectralMatching();
164 
166  double computeHyperScore(MSSpectrum<Peak1D>, MSSpectrum<Peak1D>, const double&, const double&);
167 
169  void run(MSExperiment<>&, MzTab&);
170 
171 
172  protected:
173  virtual void updateMembers_();
174 
175  private:
177  void exportMzTab_(const std::vector<SpectralMatch>&, MzTab&);
178 
183 
185  };
186 
187 
188 }
189 
190 
191 
192 
193 #endif // OPENMS_ANALYSIS_ID_METABOLITESPECTRALMATCHING_H
A more convenient string class.
Definition: String.h:57
Definition: MetaboliteSpectralMatching.h:142
Int found_precursor_charge_
Definition: MetaboliteSpectralMatching.h:126
Definition: MetaboliteSpectralMatching.h:154
double found_precursor_mass_
Definition: MetaboliteSpectralMatching.h:125
Definition: MetaboliteSpectralMatching.h:64
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
String primary_id_
Definition: MetaboliteSpectralMatching.h:132
double getMatchingScore() const
struct OpenMS::SpectralMatchScoreComparator SpectralMatchScoreGreater
double observed_precursor_mass_
Definition: MetaboliteSpectralMatching.h:123
String ion_mode_
Definition: MetaboliteSpectralMatching.h:182
String secondary_id_
Definition: MetaboliteSpectralMatching.h:133
Definition: MetaboliteSpectralMatching.h:55
Size observed_spectrum_idx_
Definition: MetaboliteSpectralMatching.h:128
struct OpenMS::PrecursorMassComparator PrecursorMZLess
String inchi_string_
Definition: MetaboliteSpectralMatching.h:136
String precursor_adduct_
Definition: MetaboliteSpectralMatching.h:138
double precursor_mz_error_
Definition: MetaboliteSpectralMatching.h:179
Size matching_spectrum_idx_
Definition: MetaboliteSpectralMatching.h:129
String common_name_
Definition: MetaboliteSpectralMatching.h:134
double matching_score_
Definition: MetaboliteSpectralMatching.h:127
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:55
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
const std::vector< Precursor > & getPrecursors() const
returns a const reference to the precursors
double observed_precursor_rt_
Definition: MetaboliteSpectralMatching.h:124
int Int
Signed integer type.
Definition: Types.h:96
String report_mode_
Definition: MetaboliteSpectralMatching.h:184
String smiles_string_
Definition: MetaboliteSpectralMatching.h:137
double fragment_mz_error_
Definition: MetaboliteSpectralMatching.h:180
String sum_formula_
Definition: MetaboliteSpectralMatching.h:135
Data model of MzTab files. Please see the official MzTab specification at https://code.google.com/p/mztab/.
Definition: MzTab.h:700
String mz_error_unit_
Definition: MetaboliteSpectralMatching.h:181

OpenMS / TOPP release 2.0.0 Documentation generated on Thu Aug 20 2015 01:44:25 using doxygen 1.8.9.1