OpenMS  2.6.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-2020.
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 {
64  class OPENMS_DLLAPI TargetedExperiment
65  {
66 public:
67 
68  struct OPENMS_DLLAPI SummaryStatistics
69  {
74  std::map<ReactionMonitoringTransition::DecoyTransitionType, size_t> decoy_counts;
76  };
77 
78 
90  typedef Residue IonType; // IonType enum of Interpretation class
91 
92  typedef std::map<String, const Protein *> ProteinReferenceMapType;
93  typedef std::map<String, const Peptide *> PeptideReferenceMapType;
94  typedef std::map<String, const Compound *> CompoundReferenceMapType;
95 
101 
104 
106  virtual ~TargetedExperiment();
108 
110  TargetedExperiment & operator=(const TargetedExperiment & rhs);
111 
115  bool operator==(const TargetedExperiment & rhs) const;
116 
117  bool operator!=(const TargetedExperiment & rhs) const;
119 
125  TargetedExperiment operator+(const TargetedExperiment & rhs) const;
126 
132  TargetedExperiment& operator+=(const TargetedExperiment & rhs);
133 
139  void clear(bool clear_meta_data);
140 
142  SummaryStatistics getSummary() const;
143 
147  // cv list
148  void setCVs(const std::vector<CV> & cvs);
149 
150  const std::vector<CV> & getCVs() const;
151 
152  void addCV(const CV & cv);
153 
154  // contact list
155  void setContacts(const std::vector<Contact> & contacts);
156 
157  const std::vector<Contact> & getContacts() const;
158 
159  void addContact(const Contact & contact);
160 
161  // publication list
162  void setPublications(const std::vector<Publication> & publications);
163 
164  const std::vector<Publication> & getPublications() const;
165 
166  void addPublication(const Publication & publication);
167 
168  // target list
169  void setTargetCVTerms(const CVTermList & cv_terms);
170 
171  const CVTermList & getTargetCVTerms() const;
172 
173  void addTargetCVTerm(const CVTerm & cv_term);
174 
175  void setTargetMetaValue(const String & name, const DataValue & value);
176 
177  // instrument list
178  void setInstruments(const std::vector<Instrument> & instruments);
179 
180  const std::vector<Instrument> & getInstruments() const;
181 
182  void addInstrument(const Instrument & instrument);
183 
184  // software list
185  void setSoftware(const std::vector<Software> & software);
186 
187  const std::vector<Software> & getSoftware() const;
188 
189  void addSoftware(const Software & software);
190 
191  // protein list
192  void setProteins(const std::vector<Protein> & proteins);
193 
194  const std::vector<Protein> & getProteins() const;
195 
196  const Protein & getProteinByRef(const String & ref) const;
197 
198  bool hasProtein(const String & ref) const;
199 
200  void addProtein(const Protein & protein);
201 
202  // compound list
203  void setCompounds(const std::vector<Compound> & rhs);
204 
205  const std::vector<Compound> & getCompounds() const;
206 
207  void addCompound(const Compound & rhs);
208 
209  void setPeptides(const std::vector<Peptide> & rhs);
210 
211  const std::vector<Peptide> & getPeptides() const;
212 
213  bool hasPeptide(const String & ref) const;
214 
215  const Peptide & getPeptideByRef(const String & ref) const;
216 
217  bool hasCompound(const String & ref) const;
218 
219  const Compound & getCompoundByRef(const String & ref) const;
220 
221  void addPeptide(const Peptide & rhs);
222 
224  void setTransitions(const std::vector<ReactionMonitoringTransition> & transitions);
225 
227  const std::vector<ReactionMonitoringTransition> & getTransitions() const;
228 
230  void addTransition(const ReactionMonitoringTransition & transition);
231 
232  void setIncludeTargets(const std::vector<IncludeExcludeTarget> & targets);
233 
234  const std::vector<IncludeExcludeTarget> & getIncludeTargets() const;
235 
236  void addIncludeTarget(const IncludeExcludeTarget & target);
237 
238  void setExcludeTargets(const std::vector<IncludeExcludeTarget> & targets);
239 
240  const std::vector<IncludeExcludeTarget> & getExcludeTargets() const;
241 
242  void addExcludeTarget(const IncludeExcludeTarget & target);
243 
245  void setSourceFiles(const std::vector<SourceFile> & source_files);
246 
248  const std::vector<SourceFile> & getSourceFiles() const;
249 
251  void addSourceFile(const SourceFile & source_file);
253 
255 
256 
259  void sortTransitionsByProductMZ();
261 
271  bool containsInvalidReferences() const;
272 
273 protected:
274 
275  void createProteinReferenceMap_() const;
276 
277  void createPeptideReferenceMap_() const;
278 
279  void createCompoundReferenceMap_() const;
280 
281  std::vector<CV> cvs_;
282 
283  std::vector<Contact> contacts_;
284 
285  std::vector<Publication> publications_;
286 
287  std::vector<Instrument> instruments_;
288 
290 
291  std::vector<Software> software_;
292 
293  std::vector<Protein> proteins_;
294 
295  std::vector<Compound> compounds_;
296 
297  std::vector<Peptide> peptides_;
298 
299  std::vector<ReactionMonitoringTransition> transitions_;
300 
301  std::vector<IncludeExcludeTarget> include_targets_;
302 
303  std::vector<IncludeExcludeTarget> exclude_targets_;
304 
305  std::vector<SourceFile> source_files_;
306 
308 
310 
312 
314 
316 
318 
319  };
320 
321  namespace TargetedExperimentHelper
322  {
323  } // namespace TargetedExperimentHelper
324 
326  OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const TargetedExperiment::SummaryStatistics& s);
327 
328 
329 } // namespace OpenMS
330 
OpenMS::Software
Description of the software used for processing.
Definition: Software.h:48
OpenMS::TargetedExperiment::compound_reference_map_
CompoundReferenceMapType compound_reference_map_
Definition: TargetedExperiment.h:315
OpenMS::TargetedExperiment::protein_reference_map_
ProteinReferenceMapType protein_reference_map_
Definition: TargetedExperiment.h:307
OpenMS::TargetedExperimentHelper::Instrument
Definition: TargetedExperimentHelper.h:478
OpenMS::TargetedExperiment::SummaryStatistics::protein_count
Size protein_count
Definition: TargetedExperiment.h:70
OpenMS::TargetedExperiment::Interpretation
TargetedExperimentHelper::Interpretation Interpretation
Definition: TargetedExperiment.h:88
OpenMS::TargetedExperiment::include_targets_
std::vector< IncludeExcludeTarget > include_targets_
Definition: TargetedExperiment.h:301
CVTerm.h
OpenMS::TargetedExperimentHelper::Peptide
Represents a peptide (amino acid sequence)
Definition: TargetedExperimentHelper.h:370
OpenMS::TargetedExperiment::Protein
TargetedExperimentHelper::Protein Protein
Definition: TargetedExperiment.h:80
OpenMS::TargetedExperiment::protein_reference_map_dirty_
bool protein_reference_map_dirty_
Definition: TargetedExperiment.h:309
OpenMS::TargetedExperiment::Compound
TargetedExperimentHelper::Compound Compound
Definition: TargetedExperiment.h:82
OpenMS::TargetedExperimentHelper::Contact
Definition: TargetedExperimentHelper.h:444
OpenMS::TargetedExperiment::proteins_
std::vector< Protein > proteins_
Definition: TargetedExperiment.h:293
OpenMS::String
A more convenient string class.
Definition: String.h:59
KDTree::operator!=
bool operator!=(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:824
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
OpenMS::IncludeExcludeTarget
This class stores a SRM/MRM transition.
Definition: IncludeExcludeTarget.h:52
OpenMS::TargetedExperiment::peptide_reference_map_dirty_
bool peptide_reference_map_dirty_
Definition: TargetedExperiment.h:313
OpenMS::TargetedExperiment::IonType
Residue IonType
Definition: TargetedExperiment.h:90
ReactionMonitoringTransition.h
OpenMS::TargetedExperiment::RetentionTime
TargetedExperimentHelper::RetentionTime RetentionTime
Definition: TargetedExperiment.h:81
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::TargetedExperiment::contacts_
std::vector< Contact > contacts_
Definition: TargetedExperiment.h:283
OpenMS::TargetedExperiment::SummaryStatistics::transition_count
Size transition_count
Definition: TargetedExperiment.h:73
OpenMS::TargetedExperiment::CV
TargetedExperimentHelper::CV CV
Definition: TargetedExperiment.h:79
OpenMS::TargetedExperiment::exclude_targets_
std::vector< IncludeExcludeTarget > exclude_targets_
Definition: TargetedExperiment.h:303
OpenMS::Residue
Representation of a residue.
Definition: Residue.h:62
OpenMS::DataValue
Class to hold strings, numeric values, lists of strings and lists of numeric values.
Definition: DataValue.h:56
OpenMS::TargetedExperiment::compound_reference_map_dirty_
bool compound_reference_map_dirty_
Definition: TargetedExperiment.h:317
Software.h
OpenMS::ReactionMonitoringTransition
This class stores a SRM/MRM transition.
Definition: ReactionMonitoringTransition.h:56
OpenMS::TargetedExperimentHelper::Protein
Definition: TargetedExperimentHelper.h:98
OpenMS::TargetedExperiment::instruments_
std::vector< Instrument > instruments_
Definition: TargetedExperiment.h:287
OpenMS::TargetedExperimentHelper::Prediction
Definition: TargetedExperimentHelper.h:495
OpenMS::TargetedExperiment::Publication
TargetedExperimentHelper::Publication Publication
Definition: TargetedExperiment.h:85
OpenMS::TargetedExperiment::SummaryStatistics::compound_count
Size compound_count
Definition: TargetedExperiment.h:72
OpenMS::TargetedExperiment::Prediction
TargetedExperimentHelper::Prediction Prediction
Definition: TargetedExperiment.h:87
OpenMS::TargetedExperimentHelper::Compound
Represents a compound (small molecule)
Definition: TargetedExperimentHelper.h:333
OpenMS::operator<<
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
OpenMS::TargetedExperiment::PeptideReferenceMapType
std::map< String, const Peptide * > PeptideReferenceMapType
Definition: TargetedExperiment.h:93
OpenMS::TargetedExperiment::Contact
TargetedExperimentHelper::Contact Contact
Definition: TargetedExperiment.h:84
OpenMS::CVTermList
Representation of controlled vocabulary term list.
Definition: CVTermList.h:52
OpenMS::TargetedExperiment::Instrument
TargetedExperimentHelper::Instrument Instrument
Definition: TargetedExperiment.h:86
OpenMS::TargetedExperimentHelper::CV
Definition: TargetedExperimentHelper.h:72
CVTermList.h
OpenMS::TargetedExperiment::SummaryStatistics
Definition: TargetedExperiment.h:68
OpenMS::Internal::operator==
bool operator==(const IDBoostGraph::ProteinGroup &lhs, const IDBoostGraph::ProteinGroup &rhs)
OpenMS::CVTerm
Representation of controlled vocabulary term.
Definition: CVTerm.h:52
OpenMS::TargetedExperiment::peptides_
std::vector< Peptide > peptides_
Definition: TargetedExperiment.h:297
OpenMS::TargetedExperiment::transitions_
std::vector< ReactionMonitoringTransition > transitions_
Definition: TargetedExperiment.h:299
OpenMS::TargetedExperimentHelper::RetentionTime
This class stores a retention time structure that is used in TargetedExperiment (representing a TraML...
Definition: TargetedExperimentHelper.h:127
OpenMS::TargetedExperiment::peptide_reference_map_
PeptideReferenceMapType peptide_reference_map_
Definition: TargetedExperiment.h:311
OpenMS::SourceFile
Description of a file location, used to store the origin of (meta) data.
Definition: SourceFile.h:46
OpenMS::TargetedExperiment::publications_
std::vector< Publication > publications_
Definition: TargetedExperiment.h:285
OpenMS::TargetedExperiment::SummaryStatistics::decoy_counts
std::map< ReactionMonitoringTransition::DecoyTransitionType, size_t > decoy_counts
# target/decoy transitions
Definition: TargetedExperiment.h:74
OpenMS::TargetedExperimentHelper::Publication
Definition: TargetedExperimentHelper.h:461
OpenMS::TargetedExperiment::ProteinReferenceMapType
std::map< String, const Protein * > ProteinReferenceMapType
Definition: TargetedExperiment.h:92
TargetedExperimentHelper.h
OpenMS::TargetedExperiment
A description of a targeted experiment containing precursor and production ions.
Definition: TargetedExperiment.h:64
OpenMS::TargetedExperiment::source_files_
std::vector< SourceFile > source_files_
Definition: TargetedExperiment.h:305
OpenMS::TargetedExperiment::software_
std::vector< Software > software_
Definition: TargetedExperiment.h:291
SourceFile.h
OpenMS::TargetedExperiment::CompoundReferenceMapType
std::map< String, const Compound * > CompoundReferenceMapType
Definition: TargetedExperiment.h:94
OpenMS::TargetedExperiment::cvs_
std::vector< CV > cvs_
Definition: TargetedExperiment.h:281
OpenMS::TargetedExperiment::Transition
ReactionMonitoringTransition Transition
Definition: TargetedExperiment.h:89
OpenMS::TargetedExperiment::Peptide
TargetedExperimentHelper::Peptide Peptide
Definition: TargetedExperiment.h:83
OpenMS::TargetedExperiment::targets_
CVTermList targets_
Definition: TargetedExperiment.h:289
StandardTypes.h
OpenMS::TargetedExperiment::SummaryStatistics::peptide_count
Size peptide_count
Definition: TargetedExperiment.h:71
OpenMS::TargetedExperimentHelper::Interpretation
Product ion interpretation.
Definition: TargetedExperimentHelper.h:520
IncludeExcludeTarget.h
OpenMS::TargetedExperiment::compounds_
std::vector< Compound > compounds_
Definition: TargetedExperiment.h:295
OpenMS::TargetedExperiment::SummaryStatistics::contains_invalid_references
bool contains_invalid_references
Definition: TargetedExperiment.h:75