OpenMS  2.7.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-2021.
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 
108 
111 
115  bool operator==(const TargetedExperiment & rhs) const;
116 
117  bool operator!=(const TargetedExperiment & rhs) const;
119 
126 
133 
139  void clear(bool clear_meta_data);
140 
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 
237 
238  void setExcludeTargets(const std::vector<IncludeExcludeTarget> & targets);
239 
240  const std::vector<IncludeExcludeTarget> & getExcludeTargets() const;
241 
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 
261 
263 
264 
269 
280 
281 protected:
282 
284 
286 
288 
289  std::vector<CV> cvs_;
290 
291  std::vector<Contact> contacts_;
292 
293  std::vector<Publication> publications_;
294 
295  std::vector<Instrument> instruments_;
296 
298 
299  std::vector<Software> software_;
300 
301  std::vector<Protein> proteins_;
302 
303  std::vector<Compound> compounds_;
304 
305  std::vector<Peptide> peptides_;
306 
307  std::vector<ReactionMonitoringTransition> transitions_;
308 
309  std::vector<IncludeExcludeTarget> include_targets_;
310 
311  std::vector<IncludeExcludeTarget> exclude_targets_;
312 
313  std::vector<SourceFile> source_files_;
314 
316 
318 
320 
322 
324 
326 
327  };
328 
329  namespace TargetedExperimentHelper
330  {
331  } // namespace TargetedExperimentHelper
332 
334  OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const TargetedExperiment::SummaryStatistics& s);
335 
336 
337 } // namespace OpenMS
338 
Representation of controlled vocabulary term list.
Definition: CVTermList.h:54
Representation of controlled vocabulary term.
Definition: CVTerm.h:53
Class to hold strings, numeric values, lists of strings and lists of numeric values.
Definition: DataValue.h:59
This class stores a SRM/MRM transition.
Definition: IncludeExcludeTarget.h:54
This class stores a SRM/MRM transition.
Definition: ReactionMonitoringTransition.h:58
Representation of a residue.
Definition: Residue.h:63
Description of the software used for processing.
Definition: Software.h:50
Description of a file location, used to store the origin of (meta) data.
Definition: SourceFile.h:48
A more convenient string class.
Definition: String.h:61
Represents a compound (small molecule)
Definition: TargetedExperimentHelper.h:323
Represents a peptide (amino acid sequence)
Definition: TargetedExperimentHelper.h:360
This class stores a retention time structure that is used in TargetedExperiment (representing a TraML...
Definition: TargetedExperimentHelper.h:126
A description of a targeted experiment containing precursor and production ions.
Definition: TargetedExperiment.h:65
std::map< String, const Protein * > ProteinReferenceMapType
Definition: TargetedExperiment.h:92
void setContacts(const std::vector< Contact > &contacts)
const std::vector< IncludeExcludeTarget > & getIncludeTargets() const
void setCVs(const std::vector< CV > &cvs)
const Peptide & getPeptideByRef(const String &ref) const
bool operator==(const TargetedExperiment &rhs) const
void createCompoundReferenceMap_() const
std::vector< Contact > contacts_
Definition: TargetedExperiment.h:291
const std::vector< Peptide > & getPeptides() const
const Protein & getProteinByRef(const String &ref) const
CVTermList targets_
Definition: TargetedExperiment.h:297
bool compound_reference_map_dirty_
Definition: TargetedExperiment.h:325
TargetedExperiment(const TargetedExperiment &rhs)
copy constructor
TargetedExperimentHelper::Interpretation Interpretation
Definition: TargetedExperiment.h:88
TargetedExperiment & operator+=(const TargetedExperiment &rhs)
Add one targeted experiment to another.
void setPeptides(const std::vector< Peptide > &rhs)
void setExcludeTargets(const std::vector< IncludeExcludeTarget > &targets)
const std::vector< Protein > & getProteins() const
void addInstrument(const Instrument &instrument)
Residue IonType
Definition: TargetedExperiment.h:90
Size transition_count
Definition: TargetedExperiment.h:73
TargetedExperiment()
default constructor
const std::vector< Software > & getSoftware() const
const Compound & getCompoundByRef(const String &ref) const
TargetedExperimentHelper::Instrument Instrument
Definition: TargetedExperiment.h:86
std::vector< CV > cvs_
Definition: TargetedExperiment.h:289
void addPeptide(const Peptide &rhs)
Size peptide_count
Definition: TargetedExperiment.h:71
void setPublications(const std::vector< Publication > &publications)
void setTransitions(const std::vector< ReactionMonitoringTransition > &transitions)
set transition list
void setTargetCVTerms(const CVTermList &cv_terms)
TargetedExperimentHelper::Prediction Prediction
Definition: TargetedExperiment.h:87
const std::vector< Publication > & getPublications() const
ReactionMonitoringTransition Transition
Definition: TargetedExperiment.h:89
TargetedExperimentHelper::Protein Protein
Definition: TargetedExperiment.h:80
std::vector< SourceFile > source_files_
Definition: TargetedExperiment.h:313
void setTargetMetaValue(const String &name, const DataValue &value)
std::vector< Peptide > peptides_
Definition: TargetedExperiment.h:305
void addSourceFile(const SourceFile &source_file)
adds a source file to the list
void setIncludeTargets(const std::vector< IncludeExcludeTarget > &targets)
void addCV(const CV &cv)
void addSoftware(const Software &software)
std::vector< Compound > compounds_
Definition: TargetedExperiment.h:303
const std::vector< Instrument > & getInstruments() const
TargetedExperiment operator+(const TargetedExperiment &rhs) const
Joins two targeted experiments.
TargetedExperimentHelper::Contact Contact
Definition: TargetedExperiment.h:84
SummaryStatistics getSummary() const
return summary stats about this TE.
const std::vector< SourceFile > & getSourceFiles() const
returns the source file list
std::vector< Instrument > instruments_
Definition: TargetedExperiment.h:295
TargetedExperimentHelper::Publication Publication
Definition: TargetedExperiment.h:85
std::map< ReactionMonitoringTransition::DecoyTransitionType, size_t > decoy_counts
# target/decoy transitions
Definition: TargetedExperiment.h:74
const std::vector< Contact > & getContacts() const
void addTargetCVTerm(const CVTerm &cv_term)
std::vector< IncludeExcludeTarget > include_targets_
Definition: TargetedExperiment.h:309
void setCompounds(const std::vector< Compound > &rhs)
ProteinReferenceMapType protein_reference_map_
Definition: TargetedExperiment.h:315
const std::vector< CV > & getCVs() const
bool hasProtein(const String &ref) const
const CVTermList & getTargetCVTerms() const
void addTransition(const ReactionMonitoringTransition &transition)
adds a transition to the list
const std::vector< IncludeExcludeTarget > & getExcludeTargets() const
Size compound_count
Definition: TargetedExperiment.h:72
std::vector< IncludeExcludeTarget > exclude_targets_
Definition: TargetedExperiment.h:311
void addExcludeTarget(const IncludeExcludeTarget &target)
TargetedExperimentHelper::Peptide Peptide
Definition: TargetedExperiment.h:83
void addProtein(const Protein &protein)
void addCompound(const Compound &rhs)
std::vector< Protein > proteins_
Definition: TargetedExperiment.h:301
void sortTransitionsByName()
Lexicographically sorts the transitions by their name.
const std::vector< ReactionMonitoringTransition > & getTransitions() const
returns the transition list
std::vector< ReactionMonitoringTransition > transitions_
Definition: TargetedExperiment.h:307
std::vector< Publication > publications_
Definition: TargetedExperiment.h:293
void sortTransitionsByProductMZ()
Lexicographically sorts the transitions by their product m/z.
TargetedExperimentHelper::CV CV
Definition: TargetedExperiment.h:79
bool hasCompound(const String &ref) const
bool hasPeptide(const String &ref) const
const std::vector< Compound > & getCompounds() const
void addIncludeTarget(const IncludeExcludeTarget &target)
void setSoftware(const std::vector< Software > &software)
bool protein_reference_map_dirty_
Definition: TargetedExperiment.h:317
std::map< String, const Peptide * > PeptideReferenceMapType
Definition: TargetedExperiment.h:93
std::vector< Software > software_
Definition: TargetedExperiment.h:299
std::map< String, const Compound * > CompoundReferenceMapType
Definition: TargetedExperiment.h:94
TargetedExperimentHelper::Compound Compound
Definition: TargetedExperiment.h:82
bool containsInvalidReferences() const
Checks whether the data structure (and the underlying TraML file) contains invalid references.
void setSourceFiles(const std::vector< SourceFile > &source_files)
sets the source files
void setProteins(const std::vector< Protein > &proteins)
PeptideReferenceMapType peptide_reference_map_
Definition: TargetedExperiment.h:319
void setInstruments(const std::vector< Instrument > &instruments)
bool contains_invalid_references
Definition: TargetedExperiment.h:75
void addPublication(const Publication &publication)
void createProteinReferenceMap_() const
TargetedExperiment & operator=(const TargetedExperiment &rhs)
assignment operator
virtual ~TargetedExperiment()
destructor
TargetedExperimentHelper::RetentionTime RetentionTime
Definition: TargetedExperiment.h:81
bool operator!=(const TargetedExperiment &rhs) const
void clear(bool clear_meta_data)
Clears all data and meta data.
void createPeptideReferenceMap_() const
CompoundReferenceMapType compound_reference_map_
Definition: TargetedExperiment.h:323
Size protein_count
Definition: TargetedExperiment.h:70
void addContact(const Contact &contact)
bool peptide_reference_map_dirty_
Definition: TargetedExperiment.h:321
Definition: TargetedExperiment.h:69
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
Definition: TargetedExperimentHelper.h:73
Definition: TargetedExperimentHelper.h:429
Definition: TargetedExperimentHelper.h:463
Product ion interpretation.
Definition: TargetedExperimentHelper.h:505
Definition: TargetedExperimentHelper.h:480
Definition: TargetedExperimentHelper.h:100
Definition: TargetedExperimentHelper.h:446