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

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:04 using doxygen 1.8.13