OpenMS  2.4.0
TargetedExperiment.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-2018.
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: Andreas Bertsch $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
40 #include <OpenMS/METADATA/CVTerm.h>
45 
46 #include <vector>
47 
48 namespace OpenMS
49 {
61  class OPENMS_DLLAPI TargetedExperiment
62  {
63 public:
64 
76  typedef Residue IonType; // IonType enum of Interpretation class
77 
78  typedef std::map<String, const Protein *> ProteinReferenceMapType;
79  typedef std::map<String, const Peptide *> PeptideReferenceMapType;
80  typedef std::map<String, const Compound *> CompoundReferenceMapType;
81 
87 
90 
92  virtual ~TargetedExperiment();
94 
96  TargetedExperiment & operator=(const TargetedExperiment & rhs);
97 
101  bool operator==(const TargetedExperiment & rhs) const;
102 
103  bool operator!=(const TargetedExperiment & rhs) const;
105 
111  TargetedExperiment operator+(const TargetedExperiment & rhs) const;
112 
118  TargetedExperiment & operator+=(const TargetedExperiment & rhs);
119 
125  void clear(bool clear_meta_data);
126 
130  // cv list
131  void setCVs(const std::vector<CV> & cvs);
132 
133  const std::vector<CV> & getCVs() const;
134 
135  void addCV(const CV & cv);
136 
137  // contact list
138  void setContacts(const std::vector<Contact> & contacts);
139 
140  const std::vector<Contact> & getContacts() const;
141 
142  void addContact(const Contact & contact);
143 
144  // publication list
145  void setPublications(const std::vector<Publication> & publications);
146 
147  const std::vector<Publication> & getPublications() const;
148 
149  void addPublication(const Publication & publication);
150 
151  // target list
152  void setTargetCVTerms(const CVTermList & cv_terms);
153 
154  const CVTermList & getTargetCVTerms() const;
155 
156  void addTargetCVTerm(const CVTerm & cv_term);
157 
158  void setTargetMetaValue(const String & name, const DataValue & value);
159 
160  // instrument list
161  void setInstruments(const std::vector<Instrument> & instruments);
162 
163  const std::vector<Instrument> & getInstruments() const;
164 
165  void addInstrument(const Instrument & instrument);
166 
167  // software list
168  void setSoftware(const std::vector<Software> & software);
169 
170  const std::vector<Software> & getSoftware() const;
171 
172  void addSoftware(const Software & software);
173 
174  // protein list
175  void setProteins(const std::vector<Protein> & proteins);
176 
177  const std::vector<Protein> & getProteins() const;
178 
179  const Protein & getProteinByRef(const String & ref) const;
180 
181  bool hasProtein(const String & ref) const;
182 
183  void addProtein(const Protein & protein);
184 
185  // compound list
186  void setCompounds(const std::vector<Compound> & rhs);
187 
188  const std::vector<Compound> & getCompounds() const;
189 
190  void addCompound(const Compound & rhs);
191 
192  void setPeptides(const std::vector<Peptide> & rhs);
193 
194  const std::vector<Peptide> & getPeptides() const;
195 
196  bool hasPeptide(const String & ref) const;
197 
198  const Peptide & getPeptideByRef(const String & ref) const;
199 
200  bool hasCompound(const String & ref) const;
201 
202  const Compound & getCompoundByRef(const String & ref) const;
203 
204  void addPeptide(const Peptide & rhs);
205 
207  void setTransitions(const std::vector<ReactionMonitoringTransition> & transitions);
208 
210  const std::vector<ReactionMonitoringTransition> & getTransitions() const;
211 
213  void addTransition(const ReactionMonitoringTransition & transition);
214 
215  void setIncludeTargets(const std::vector<IncludeExcludeTarget> & targets);
216 
217  const std::vector<IncludeExcludeTarget> & getIncludeTargets() const;
218 
219  void addIncludeTarget(const IncludeExcludeTarget & target);
220 
221  void setExcludeTargets(const std::vector<IncludeExcludeTarget> & targets);
222 
223  const std::vector<IncludeExcludeTarget> & getExcludeTargets() const;
224 
225  void addExcludeTarget(const IncludeExcludeTarget & target);
226 
228  void setSourceFiles(const std::vector<SourceFile> & source_files);
229 
231  const std::vector<SourceFile> & getSourceFiles() const;
232 
234  void addSourceFile(const SourceFile & source_file);
236 
238 
239 
242  void sortTransitionsByProductMZ();
244 
254  bool containsInvalidReferences() const;
255 
256 protected:
257 
258  void createProteinReferenceMap_() const;
259 
260  void createPeptideReferenceMap_() const;
261 
262  void createCompoundReferenceMap_() const;
263 
264  std::vector<CV> cvs_;
265 
266  std::vector<Contact> contacts_;
267 
268  std::vector<Publication> publications_;
269 
270  std::vector<Instrument> instruments_;
271 
273 
274  std::vector<Software> software_;
275 
276  std::vector<Protein> proteins_;
277 
278  std::vector<Compound> compounds_;
279 
280  std::vector<Peptide> peptides_;
281 
282  std::vector<ReactionMonitoringTransition> transitions_;
283 
284  std::vector<IncludeExcludeTarget> include_targets_;
285 
286  std::vector<IncludeExcludeTarget> exclude_targets_;
287 
288  std::vector<SourceFile> source_files_;
289 
290  mutable ProteinReferenceMapType protein_reference_map_;
291 
293 
294  mutable PeptideReferenceMapType peptide_reference_map_;
295 
297 
298  mutable CompoundReferenceMapType compound_reference_map_;
299 
301 
302  };
303 
304  namespace TargetedExperimentHelper
305  {
306  } // namespace TargetedExperimentHelper
307 
308 
309 } // namespace OpenMS
310 
CVTermList targets_
Definition: TargetedExperiment.h:272
A more convenient string class.
Definition: String.h:57
std::vector< IncludeExcludeTarget > include_targets_
Definition: TargetedExperiment.h:284
Representation of controlled vocabulary term list.
Definition: CVTermList.h:52
Definition: TargetedExperimentHelper.h:572
TargetedExperimentHelper::Peptide Peptide
Definition: TargetedExperiment.h:69
ProteinReferenceMapType protein_reference_map_
Definition: TargetedExperiment.h:290
std::vector< Protein > proteins_
Definition: TargetedExperiment.h:276
bool operator==(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:806
Description of a file location, used to store the origin of (meta) data.
Definition: SourceFile.h:46
Product ion interpretation.
Definition: TargetedExperimentHelper.h:665
std::vector< Peptide > peptides_
Definition: TargetedExperiment.h:280
Definition: TargetedExperimentHelper.h:544
Description of the software used for processing.
Definition: Software.h:48
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
Representation of a residue.
Definition: Residue.h:61
Residue IonType
Definition: TargetedExperiment.h:76
Class to hold strings, numeric values, lists of strings and lists of numeric values.
Definition: DataValue.h:56
bool peptide_reference_map_dirty_
Definition: TargetedExperiment.h:296
std::vector< SourceFile > source_files_
Definition: TargetedExperiment.h:288
std::vector< Compound > compounds_
Definition: TargetedExperiment.h:278
std::map< String, const Peptide * > PeptideReferenceMapType
Definition: TargetedExperiment.h:79
std::vector< Contact > contacts_
Definition: TargetedExperiment.h:266
std::vector< Instrument > instruments_
Definition: TargetedExperiment.h:270
TargetedExperimentHelper::Prediction Prediction
Definition: TargetedExperiment.h:73
TargetedExperimentHelper::Protein Protein
Definition: TargetedExperiment.h:66
Representation of controlled vocabulary term.
Definition: CVTerm.h:50
std::vector< CV > cvs_
Definition: TargetedExperiment.h:264
Represents a compound (small molecule)
Definition: TargetedExperimentHelper.h:399
TargetedExperimentHelper::Interpretation Interpretation
Definition: TargetedExperiment.h:74
std::map< String, const Protein * > ProteinReferenceMapType
Definition: TargetedExperiment.h:78
std::map< String, const Compound * > CompoundReferenceMapType
Definition: TargetedExperiment.h:80
bool protein_reference_map_dirty_
Definition: TargetedExperiment.h:292
Definition: TargetedExperimentHelper.h:85
This class stores a SRM/MRM transition.
Definition: IncludeExcludeTarget.h:52
std::vector< ReactionMonitoringTransition > transitions_
Definition: TargetedExperiment.h:282
bool operator!=(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:824
PeptideReferenceMapType peptide_reference_map_
Definition: TargetedExperiment.h:294
std::vector< IncludeExcludeTarget > exclude_targets_
Definition: TargetedExperiment.h:286
A description of a targeted experiment containing precursor and production ions.
Definition: TargetedExperiment.h:61
Definition: TargetedExperimentHelper.h:600
This class stores a retention time structure that is used in TargetedExperiment (representing a TraML...
Definition: TargetedExperimentHelper.h:152
TargetedExperimentHelper::Instrument Instrument
Definition: TargetedExperiment.h:72
Definition: TargetedExperimentHelper.h:628
std::vector< Software > software_
Definition: TargetedExperiment.h:274
TargetedExperimentHelper::Publication Publication
Definition: TargetedExperiment.h:71
Definition: TargetedExperimentHelper.h:111
ReactionMonitoringTransition Transition
Definition: TargetedExperiment.h:75
CompoundReferenceMapType compound_reference_map_
Definition: TargetedExperiment.h:298
bool compound_reference_map_dirty_
Definition: TargetedExperiment.h:300
TargetedExperimentHelper::Contact Contact
Definition: TargetedExperiment.h:70
TargetedExperimentHelper::Compound Compound
Definition: TargetedExperiment.h:68
std::vector< Publication > publications_
Definition: TargetedExperiment.h:268
TargetedExperimentHelper::CV CV
Definition: TargetedExperiment.h:65
Represents a peptide (amino acid sequence)
Definition: TargetedExperimentHelper.h:451
This class stores a SRM/MRM transition.
Definition: ReactionMonitoringTransition.h:56
TargetedExperimentHelper::RetentionTime RetentionTime
Definition: TargetedExperiment.h:67