OpenMS
TransitionExperiment.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Hannes Roest $
6 // $Authors: Hannes Roest $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <string>
12 #include <vector>
13 #include <map>
14 
15 #include <OpenMS/OPENSWATHALGO/OpenSwathAlgoConfig.h>
16 
17 namespace OpenSwath
18 {
20  {
21  std::string transition_name;
22  std::string peptide_ref;
24  double product_mz{};
25  double precursor_mz{};
26  double precursor_im{-1};
28  bool decoy{};
32 
34  {
35  return fragment_charge;
36  }
37 
39  {
40  return !(fragment_charge == 0);
41  }
42 
43  bool isPrecursorImSet() const
44  {
45  return !(precursor_im == -1);
46  }
47 
48  std::string getNativeID() const
49  {
50  return transition_name;
51  }
52 
53  std::string getPeptideRef() const
54  {
55  return peptide_ref;
56  }
57 
58  std::string getCompoundRef() const
59  {
60  return peptide_ref;
61  }
62 
63  double getLibraryIntensity() const
64  {
65  return library_intensity;
66  }
67 
68  void setLibraryIntensity(double l)
69  {
71  }
72 
73  double getProductMZ() const
74  {
75  return product_mz;
76  }
77 
78  double getPrecursorMZ() const
79  {
80  return precursor_mz;
81  }
82 
83  double getPrecursorIM() const
84  {
85  return precursor_im;
86  }
87 
88  void setDetectingTransition (bool d)
89  {
91  }
92 
93  bool isDetectingTransition() const
94  {
95  return detecting_transition;
96  }
97 
99  {
101  }
102 
104  {
105  return quantifying_transition;
106  }
107 
109  {
111  }
112 
114  {
115  return identifying_transition;
116  }
117  };
118 
120  {
121  int location;
123  };
124 
125  // A compound is either a peptide or a metabolite
127  {
128 
130  drift_time(-1),
131  charge(0)
132  {
133  }
134 
135  double drift_time;
136  double rt;
137  int charge;
138  std::string sequence;
139  std::vector<std::string> protein_refs;
140  // 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)
141  std::string peptide_group_label;
142  std::string gene_name;
143  std::string id;
144 
145  // for metabolites
146  std::string sum_formula;
147  std::string compound_name;
148 
149  // By convention, if there is no (metabolic) compound name, it is a peptide
150  bool isPeptide() const
151  {
152  return compound_name.empty();
153  }
154 
155  void setChargeState(int ch)
156  {
157  charge = ch;
158  }
159 
160  int getChargeState() const
161  {
162  return charge;
163  }
164 
165  void setDriftTime(double d)
166  {
167  drift_time = d;
168  }
169 
170  double getDriftTime() const
171  {
172  return drift_time;
173  }
174 
175  std::vector<LightModification> modifications;
176  };
177 
179  {
180  std::string id;
181  std::string sequence;
182  };
183 
185  {
187 
192 
193  std::vector<LightTransition> transitions;
194  std::vector<LightCompound> compounds;
195  std::vector<LightProtein> proteins;
196  std::vector<LightTransition> & getTransitions()
197  {
198  return transitions;
199  }
200 
201  const std::vector<LightTransition> & getTransitions() const
202  {
203  return transitions;
204  }
205 
206  std::vector<LightCompound> & getCompounds()
207  {
208  return compounds;
209  }
210 
211  const std::vector<LightCompound> & getCompounds() const
212  {
213  return compounds;
214  }
215 
216  std::vector<LightProtein> & getProteins()
217  {
218  return proteins;
219  }
220 
221  const std::vector<LightProtein> & getProteins() const
222  {
223  return proteins;
224  }
225 
226  // legacy
227  const LightCompound& getPeptideByRef(const std::string& ref)
228  {
229  return getCompoundByRef(ref);
230  }
231 
232  const LightCompound& getCompoundByRef(const std::string& ref)
233  {
235  {
237  }
238  return *(compound_reference_map_[ref]);
239  }
240 
241  private:
242 
244  {
245  for (size_t i = 0; i < getCompounds().size(); i++)
246  {
248  }
250  }
251 
252  // Map of compounds (peptides or metabolites)
254  std::map<std::string, LightCompound*> compound_reference_map_;
255 
256  };
257 
258 } //end Namespace OpenSwath
259 
Definition: Scoring.h:18
int unimod_id
Definition: TransitionExperiment.h:122
int location
Definition: TransitionExperiment.h:121
std::string sequence
Definition: TransitionExperiment.h:181
std::string id
Definition: TransitionExperiment.h:180
Definition: TransitionExperiment.h:120
Definition: TransitionExperiment.h:179
Definition: TransitionExperiment.h:127
std::vector< std::string > protein_refs
Definition: TransitionExperiment.h:139
std::string sum_formula
Definition: TransitionExperiment.h:146
void setDriftTime(double d)
Definition: TransitionExperiment.h:165
std::string gene_name
Definition: TransitionExperiment.h:142
bool isPeptide() const
Definition: TransitionExperiment.h:150
int getChargeState() const
Definition: TransitionExperiment.h:160
std::string peptide_group_label
Definition: TransitionExperiment.h:141
std::vector< LightModification > modifications
Definition: TransitionExperiment.h:175
double drift_time
Definition: TransitionExperiment.h:135
std::string sequence
Definition: TransitionExperiment.h:138
void setChargeState(int ch)
Definition: TransitionExperiment.h:155
LightCompound()
Definition: TransitionExperiment.h:129
std::string compound_name
Definition: TransitionExperiment.h:147
double getDriftTime() const
Definition: TransitionExperiment.h:170
double rt
Definition: TransitionExperiment.h:136
int charge
Definition: TransitionExperiment.h:137
std::string id
Definition: TransitionExperiment.h:143
Definition: TransitionExperiment.h:185
const LightCompound & getCompoundByRef(const std::string &ref)
Definition: TransitionExperiment.h:232
const std::vector< LightProtein > & getProteins() const
Definition: TransitionExperiment.h:221
std::vector< LightTransition > transitions
Definition: TransitionExperiment.h:193
std::vector< LightProtein > proteins
Definition: TransitionExperiment.h:195
std::vector< LightTransition > & getTransitions()
Definition: TransitionExperiment.h:196
bool compound_reference_map_dirty_
Definition: TransitionExperiment.h:253
void createPeptideReferenceMap_()
Definition: TransitionExperiment.h:243
std::map< std::string, LightCompound * > compound_reference_map_
Definition: TransitionExperiment.h:254
LightProtein Protein
Definition: TransitionExperiment.h:191
LightCompound Compound
Definition: TransitionExperiment.h:190
const std::vector< LightCompound > & getCompounds() const
Definition: TransitionExperiment.h:211
std::vector< LightCompound > & getCompounds()
Definition: TransitionExperiment.h:206
std::vector< LightProtein > & getProteins()
Definition: TransitionExperiment.h:216
LightTransition Transition
Definition: TransitionExperiment.h:188
const std::vector< LightTransition > & getTransitions() const
Definition: TransitionExperiment.h:201
LightTargetedExperiment()
Definition: TransitionExperiment.h:186
LightCompound Peptide
Definition: TransitionExperiment.h:189
const LightCompound & getPeptideByRef(const std::string &ref)
Definition: TransitionExperiment.h:227
std::vector< LightCompound > compounds
Definition: TransitionExperiment.h:194
Definition: TransitionExperiment.h:20
void setLibraryIntensity(double l)
Definition: TransitionExperiment.h:68
std::string transition_name
Definition: TransitionExperiment.h:21
void setIdentifyingTransition(bool i)
Definition: TransitionExperiment.h:108
std::string getPeptideRef() const
Definition: TransitionExperiment.h:53
double getPrecursorMZ() const
Definition: TransitionExperiment.h:78
bool decoy
Definition: TransitionExperiment.h:28
double getProductMZ() const
Definition: TransitionExperiment.h:73
std::string peptide_ref
Definition: TransitionExperiment.h:22
void setQuantifyingTransition(bool q)
Definition: TransitionExperiment.h:98
bool isProductChargeStateSet() const
Definition: TransitionExperiment.h:38
int fragment_charge
Definition: TransitionExperiment.h:27
double product_mz
Definition: TransitionExperiment.h:24
bool isIdentifyingTransition() const
Definition: TransitionExperiment.h:113
double getLibraryIntensity() const
Definition: TransitionExperiment.h:63
bool isQuantifyingTransition() const
Definition: TransitionExperiment.h:103
bool detecting_transition
Definition: TransitionExperiment.h:29
std::string getNativeID() const
Definition: TransitionExperiment.h:48
bool isDetectingTransition() const
Definition: TransitionExperiment.h:93
void setDetectingTransition(bool d)
Definition: TransitionExperiment.h:88
double getPrecursorIM() const
Definition: TransitionExperiment.h:83
bool isPrecursorImSet() const
Definition: TransitionExperiment.h:43
std::string getCompoundRef() const
Definition: TransitionExperiment.h:58
bool quantifying_transition
Definition: TransitionExperiment.h:30
double library_intensity
Definition: TransitionExperiment.h:23
bool identifying_transition
Definition: TransitionExperiment.h:31
double precursor_mz
Definition: TransitionExperiment.h:25
int getProductChargeState() const
Definition: TransitionExperiment.h:33
double precursor_im
Definition: TransitionExperiment.h:26