OpenMS  3.0.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-2022.
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  TargetedExperiment(TargetedExperiment && rhs) noexcept;
107 
109  virtual ~TargetedExperiment();
111 
113  TargetedExperiment & operator=(const TargetedExperiment & rhs);
114 
116  TargetedExperiment & operator=(TargetedExperiment && rhs) noexcept;
117 
121  bool operator==(const TargetedExperiment & rhs) const;
122 
123  bool operator!=(const TargetedExperiment & rhs) const;
125 
132 
138  TargetedExperiment& operator+=(const TargetedExperiment & rhs);
139  TargetedExperiment& operator+=(TargetedExperiment && rhs);
140 
146  void clear(bool clear_meta_data);
147 
149  SummaryStatistics getSummary() const;
150 
154  // cv list
155  void setCVs(const std::vector<CV> & cvs);
156 
157  const std::vector<CV> & getCVs() const;
158 
159  void addCV(const CV & cv);
160 
161  // contact list
162  void setContacts(const std::vector<Contact> & contacts);
163 
164  const std::vector<Contact> & getContacts() const;
165 
166  void addContact(const Contact & contact);
167 
168  // publication list
169  void setPublications(const std::vector<Publication> & publications);
170 
171  const std::vector<Publication> & getPublications() const;
172 
173  void addPublication(const Publication & publication);
174 
175  // target list
176  void setTargetCVTerms(const CVTermList & cv_terms);
177 
178  const CVTermList & getTargetCVTerms() const;
179 
180  void addTargetCVTerm(const CVTerm & cv_term);
181 
182  void setTargetMetaValue(const String & name, const DataValue & value);
183 
184  // instrument list
185  void setInstruments(const std::vector<Instrument> & instruments);
186 
187  const std::vector<Instrument> & getInstruments() const;
188 
189  void addInstrument(const Instrument & instrument);
190 
191  // software list
192  void setSoftware(const std::vector<Software> & software);
193 
194  const std::vector<Software> & getSoftware() const;
195 
196  void addSoftware(const Software & software);
197 
198  // protein list
199  void setProteins(const std::vector<Protein> & proteins);
200  void setProteins(std::vector<Protein> && proteins);
201 
202  const std::vector<Protein> & getProteins() const;
203 
204  const Protein & getProteinByRef(const String & ref) const;
205 
206  bool hasProtein(const String & ref) const;
207 
208  void addProtein(const Protein & protein);
209 
210  // compound list
211  void setCompounds(const std::vector<Compound> & rhs);
212 
213  const std::vector<Compound> & getCompounds() const;
214 
215  void addCompound(const Compound & rhs);
216 
217  void setPeptides(const std::vector<Peptide> & rhs);
218  void setPeptides(std::vector<Peptide> && rhs);
219 
220  const std::vector<Peptide> & getPeptides() const;
221 
222  bool hasPeptide(const String & ref) const;
223 
224  const Peptide & getPeptideByRef(const String & ref) const;
225 
226  bool hasCompound(const String & ref) const;
227 
228  const Compound & getCompoundByRef(const String & ref) const;
229 
230  void addPeptide(const Peptide & rhs);
231 
233  void setTransitions(const std::vector<ReactionMonitoringTransition> & transitions);
234  void setTransitions(std::vector<ReactionMonitoringTransition> && transitions);
235 
237  const std::vector<ReactionMonitoringTransition> & getTransitions() const;
238 
240  void addTransition(const ReactionMonitoringTransition & transition);
241 
242  void setIncludeTargets(const std::vector<IncludeExcludeTarget> & targets);
243 
244  const std::vector<IncludeExcludeTarget> & getIncludeTargets() const;
245 
246  void addIncludeTarget(const IncludeExcludeTarget & target);
247 
248  void setExcludeTargets(const std::vector<IncludeExcludeTarget> & targets);
249 
250  const std::vector<IncludeExcludeTarget> & getExcludeTargets() const;
251 
252  void addExcludeTarget(const IncludeExcludeTarget & target);
253 
255  void setSourceFiles(const std::vector<SourceFile> & source_files);
256 
258  const std::vector<SourceFile> & getSourceFiles() const;
259 
261  void addSourceFile(const SourceFile & source_file);
263 
265 
266 
269  void sortTransitionsByProductMZ();
271 
273 
274 
277  void sortTransitionsByName();
279 
289  bool containsInvalidReferences() const;
290 
291 protected:
292 
293  void createProteinReferenceMap_() const;
294 
295  void createPeptideReferenceMap_() const;
296 
297  void createCompoundReferenceMap_() const;
298 
299  std::vector<CV> cvs_;
300 
301  std::vector<Contact> contacts_;
302 
303  std::vector<Publication> publications_;
304 
305  std::vector<Instrument> instruments_;
306 
308 
309  std::vector<Software> software_;
310 
311  std::vector<Protein> proteins_;
312 
313  std::vector<Compound> compounds_;
314 
315  std::vector<Peptide> peptides_;
316 
317  std::vector<ReactionMonitoringTransition> transitions_;
318 
319  std::vector<IncludeExcludeTarget> include_targets_;
320 
321  std::vector<IncludeExcludeTarget> exclude_targets_;
322 
323  std::vector<SourceFile> source_files_;
324 
326 
328 
330 
332 
334 
336 
337  };
338 
339  namespace TargetedExperimentHelper
340  {
341  } // namespace TargetedExperimentHelper
342 
344  OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const TargetedExperiment::SummaryStatistics& s);
345 
346 
347 } // namespace OpenMS
348 
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:333
OpenMS::TargetedExperiment::protein_reference_map_
ProteinReferenceMapType protein_reference_map_
Definition: TargetedExperiment.h:325
OpenMS::TargetedExperimentHelper::Instrument
Definition: TargetedExperimentHelper.h:461
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:319
CVTerm.h
OpenMS::TargetedExperimentHelper::Peptide
Represents a peptide (amino acid sequence)
Definition: TargetedExperimentHelper.h:358
OpenMS::TargetedExperiment::Protein
TargetedExperimentHelper::Protein Protein
Definition: TargetedExperiment.h:80
OpenMS::TargetedExperiment::protein_reference_map_dirty_
bool protein_reference_map_dirty_
Definition: TargetedExperiment.h:327
OpenMS::TargetedExperiment::Compound
TargetedExperimentHelper::Compound Compound
Definition: TargetedExperiment.h:82
OpenMS::TargetedExperimentHelper::Contact
Definition: TargetedExperimentHelper.h:427
OpenMS::TargetedExperiment::proteins_
std::vector< Protein > proteins_
Definition: TargetedExperiment.h:311
OpenMS::String
A more convenient string class.
Definition: String.h:58
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:331
OpenMS::TargetedExperiment::IonType
Residue IonType
Definition: TargetedExperiment.h:90
ReactionMonitoringTransition.h
OpenMS::TargetedExperiment::RetentionTime
TargetedExperimentHelper::RetentionTime RetentionTime
Definition: TargetedExperiment.h:81
OpenMS::operator+
FS_TV operator+(const TV_STATUS left, const TV_STATUS right)
allow + operations on the enum, e.g. 'HAS_CANVAS + HAS_LAYER + IS_1D_VIEW'
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::TargetedExperiment::contacts_
std::vector< Contact > contacts_
Definition: TargetedExperiment.h:301
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:321
OpenMS::Residue
Representation of an amino acid residue.
Definition: Residue.h:62
OpenMS::DataValue
Class to hold strings, numeric values, lists of strings and lists of numeric values.
Definition: DataValue.h:58
OpenMS::TargetedExperiment::compound_reference_map_dirty_
bool compound_reference_map_dirty_
Definition: TargetedExperiment.h:335
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:305
OpenMS::TargetedExperimentHelper::Prediction
Definition: TargetedExperimentHelper.h:478
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:321
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:315
OpenMS::TargetedExperiment::transitions_
std::vector< ReactionMonitoringTransition > transitions_
Definition: TargetedExperiment.h:317
OpenMS::TargetedExperimentHelper::RetentionTime
This class stores a retention time structure that is used in TargetedExperiment (representing a TraML...
Definition: TargetedExperimentHelper.h:124
OpenMS::TargetedExperiment::peptide_reference_map_
PeptideReferenceMapType peptide_reference_map_
Definition: TargetedExperiment.h:329
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:303
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:444
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:323
OpenMS::TargetedExperiment::software_
std::vector< Software > software_
Definition: TargetedExperiment.h:309
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:299
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:307
StandardTypes.h
OpenMS::TargetedExperiment::SummaryStatistics::peptide_count
Size peptide_count
Definition: TargetedExperiment.h:71
OpenMS::TargetedExperimentHelper::Interpretation
Product ion interpretation.
Definition: TargetedExperimentHelper.h:503
IncludeExcludeTarget.h
OpenMS::TargetedExperiment::compounds_
std::vector< Compound > compounds_
Definition: TargetedExperiment.h:313
OpenMS::TargetedExperiment::SummaryStatistics::contains_invalid_references
bool contains_invalid_references
Definition: TargetedExperiment.h:75