OpenMS  2.8.0
TransitionExperiment.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-2021.
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: Hannes Roest $
32 // $Authors: Hannes Roest $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 #include <string>
38 #include <vector>
39 #include <map>
40 
41 #include <OpenMS/OPENSWATHALGO/OpenSwathAlgoConfig.h>
42 
43 namespace OpenSwath
44 {
46  {
47 public:
48 
51  {
52  }
53 
54  std::string transition_name;
55  std::string peptide_ref;
57  double product_mz;
58  double precursor_mz;
60  bool decoy;
64 
66  {
67  return fragment_charge;
68  }
69 
71  {
72  return !(fragment_charge == 0);
73  }
74 
75  std::string getNativeID() const
76  {
77  return transition_name;
78  }
79 
80  std::string getPeptideRef() const
81  {
82  return peptide_ref;
83  }
84 
85  std::string getCompoundRef() const
86  {
87  return peptide_ref;
88  }
89 
90  double getLibraryIntensity() const
91  {
92  return library_intensity;
93  }
94 
95  void setLibraryIntensity(double l)
96  {
98  }
99 
100  double getProductMZ() const
101  {
102  return product_mz;
103  }
104 
105  double getPrecursorMZ() const
106  {
107  return precursor_mz;
108  }
109 
111  {
113  }
114 
116  {
117  return detecting_transition;
118  }
119 
121  {
123  }
124 
126  {
127  return quantifying_transition;
128  }
129 
131  {
133  }
134 
136  {
137  return identifying_transition;
138  }
139  };
140 
142  {
143  int location;
145  };
146 
147  // A compound is either a peptide or a metabolite
149  {
150 
152  drift_time(-1),
153  charge(0)
154  {
155  }
156 
157  double drift_time;
158  double rt;
159  int charge;
160  std::string sequence;
161  std::vector<std::string> protein_refs;
162  // Peptide group label (corresponds to MS:1000893, all peptides that are isotopic forms of the same peptide should be assigned the same peptide group label)
163  std::string peptide_group_label;
164  std::string gene_name;
165  std::string id;
166 
167  // for metabolites
168  std::string sum_formula;
169  std::string compound_name;
170 
171  // By convention, if there is no (metabolic) compound name, it is a peptide
172  bool isPeptide() const
173  {
174  return compound_name.empty();
175  }
176 
177  void setChargeState(int ch)
178  {
179  charge = ch;
180  }
181 
182  int getChargeState() const
183  {
184  return charge;
185  }
186 
187  void setDriftTime(double d)
188  {
189  drift_time = d;
190  }
191 
192  double getDriftTime() const
193  {
194  return drift_time;
195  }
196 
197  std::vector<LightModification> modifications;
198  };
199 
201  {
202  std::string id;
203  std::string sequence;
204  };
205 
207  {
209 
214 
215  std::vector<LightTransition> transitions;
216  std::vector<LightCompound> compounds;
217  std::vector<LightProtein> proteins;
218  std::vector<LightTransition> & getTransitions()
219  {
220  return transitions;
221  }
222 
223  const std::vector<LightTransition> & getTransitions() const
224  {
225  return transitions;
226  }
227 
228  std::vector<LightCompound> & getCompounds()
229  {
230  return compounds;
231  }
232 
233  const std::vector<LightCompound> & getCompounds() const
234  {
235  return compounds;
236  }
237 
238  std::vector<LightProtein> & getProteins()
239  {
240  return proteins;
241  }
242 
243  const std::vector<LightProtein> & getProteins() const
244  {
245  return proteins;
246  }
247 
248  // legacy
249  const LightCompound& getPeptideByRef(const std::string& ref)
250  {
251  return getCompoundByRef(ref);
252  }
253 
254  const LightCompound& getCompoundByRef(const std::string& ref)
255  {
257  {
259  }
260  return *(compound_reference_map_[ref]);
261  }
262 
263  private:
264 
266  {
267  for (size_t i = 0; i < getCompounds().size(); i++)
268  {
270  }
272  }
273 
274  // Map of compounds (peptides or metabolites)
276  std::map<std::string, LightCompound*> compound_reference_map_;
277 
278  };
279 
280 } //end Namespace OpenSwath
281 
Definition: Scoring.h:44
int unimod_id
Definition: TransitionExperiment.h:144
int location
Definition: TransitionExperiment.h:143
std::string sequence
Definition: TransitionExperiment.h:203
std::string id
Definition: TransitionExperiment.h:202
Definition: TransitionExperiment.h:142
Definition: TransitionExperiment.h:201
Definition: TransitionExperiment.h:149
std::vector< std::string > protein_refs
Definition: TransitionExperiment.h:161
std::string sum_formula
Definition: TransitionExperiment.h:168
void setDriftTime(double d)
Definition: TransitionExperiment.h:187
std::string gene_name
Definition: TransitionExperiment.h:164
bool isPeptide() const
Definition: TransitionExperiment.h:172
int getChargeState() const
Definition: TransitionExperiment.h:182
std::string peptide_group_label
Definition: TransitionExperiment.h:163
std::vector< LightModification > modifications
Definition: TransitionExperiment.h:197
double drift_time
Definition: TransitionExperiment.h:157
std::string sequence
Definition: TransitionExperiment.h:160
void setChargeState(int ch)
Definition: TransitionExperiment.h:177
LightCompound()
Definition: TransitionExperiment.h:151
std::string compound_name
Definition: TransitionExperiment.h:169
double getDriftTime() const
Definition: TransitionExperiment.h:192
double rt
Definition: TransitionExperiment.h:158
int charge
Definition: TransitionExperiment.h:159
std::string id
Definition: TransitionExperiment.h:165
Definition: TransitionExperiment.h:207
const LightCompound & getCompoundByRef(const std::string &ref)
Definition: TransitionExperiment.h:254
const std::vector< LightProtein > & getProteins() const
Definition: TransitionExperiment.h:243
std::vector< LightTransition > transitions
Definition: TransitionExperiment.h:215
std::vector< LightProtein > proteins
Definition: TransitionExperiment.h:217
std::vector< LightTransition > & getTransitions()
Definition: TransitionExperiment.h:218
bool compound_reference_map_dirty_
Definition: TransitionExperiment.h:275
void createPeptideReferenceMap_()
Definition: TransitionExperiment.h:265
std::map< std::string, LightCompound * > compound_reference_map_
Definition: TransitionExperiment.h:276
LightProtein Protein
Definition: TransitionExperiment.h:213
LightCompound Compound
Definition: TransitionExperiment.h:212
const std::vector< LightCompound > & getCompounds() const
Definition: TransitionExperiment.h:233
std::vector< LightCompound > & getCompounds()
Definition: TransitionExperiment.h:228
std::vector< LightProtein > & getProteins()
Definition: TransitionExperiment.h:238
LightTransition Transition
Definition: TransitionExperiment.h:210
const std::vector< LightTransition > & getTransitions() const
Definition: TransitionExperiment.h:223
LightTargetedExperiment()
Definition: TransitionExperiment.h:208
LightCompound Peptide
Definition: TransitionExperiment.h:211
const LightCompound & getPeptideByRef(const std::string &ref)
Definition: TransitionExperiment.h:249
std::vector< LightCompound > compounds
Definition: TransitionExperiment.h:216
Definition: TransitionExperiment.h:46
void setLibraryIntensity(double l)
Definition: TransitionExperiment.h:95
std::string transition_name
Definition: TransitionExperiment.h:54
void setIdentifyingTransition(bool i)
Definition: TransitionExperiment.h:130
std::string getPeptideRef() const
Definition: TransitionExperiment.h:80
double getPrecursorMZ() const
Definition: TransitionExperiment.h:105
bool decoy
Definition: TransitionExperiment.h:60
double getProductMZ() const
Definition: TransitionExperiment.h:100
std::string peptide_ref
Definition: TransitionExperiment.h:55
void setQuantifyingTransition(bool q)
Definition: TransitionExperiment.h:120
bool isProductChargeStateSet() const
Definition: TransitionExperiment.h:70
int fragment_charge
Definition: TransitionExperiment.h:59
double product_mz
Definition: TransitionExperiment.h:57
bool isIdentifyingTransition() const
Definition: TransitionExperiment.h:135
double getLibraryIntensity() const
Definition: TransitionExperiment.h:90
bool isQuantifyingTransition() const
Definition: TransitionExperiment.h:125
bool detecting_transition
Definition: TransitionExperiment.h:61
std::string getNativeID() const
Definition: TransitionExperiment.h:75
bool isDetectingTransition() const
Definition: TransitionExperiment.h:115
void setDetectingTransition(bool d)
Definition: TransitionExperiment.h:110
std::string getCompoundRef() const
Definition: TransitionExperiment.h:85
bool quantifying_transition
Definition: TransitionExperiment.h:62
LightTransition()
Definition: TransitionExperiment.h:49
double library_intensity
Definition: TransitionExperiment.h:56
bool identifying_transition
Definition: TransitionExperiment.h:63
double precursor_mz
Definition: TransitionExperiment.h:58
int getProductChargeState() const
Definition: TransitionExperiment.h:65