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