OpenMS  2.8.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 
107 
111 
114 
117 
121  bool operator==(const TargetedExperiment & rhs) const;
122 
123  bool operator!=(const TargetedExperiment & rhs) const;
125 
132 
140 
146  void clear(bool clear_meta_data);
147 
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 
247 
248  void setExcludeTargets(const std::vector<IncludeExcludeTarget> & targets);
249 
250  const std::vector<IncludeExcludeTarget> & getExcludeTargets() const;
251 
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 
271 
273 
274 
279 
290 
291 protected:
292 
294 
296 
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 
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:60
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)
TargetedExperiment & operator=(TargetedExperiment &&rhs) noexcept
move assignment operator
const Peptide & getPeptideByRef(const String &ref) const
bool operator==(const TargetedExperiment &rhs) const
void createCompoundReferenceMap_() const
std::vector< Contact > contacts_
Definition: TargetedExperiment.h:301
const std::vector< Peptide > & getPeptides() const
const Protein & getProteinByRef(const String &ref) const
CVTermList targets_
Definition: TargetedExperiment.h:307
bool compound_reference_map_dirty_
Definition: TargetedExperiment.h:335
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
TargetedExperiment(TargetedExperiment &&rhs) noexcept
move constructor
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
TargetedExperiment & operator+=(TargetedExperiment &&rhs)
std::vector< CV > cvs_
Definition: TargetedExperiment.h:299
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)
void setProteins(std::vector< Protein > &&proteins)
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:323
void setTargetMetaValue(const String &name, const DataValue &value)
std::vector< Peptide > peptides_
Definition: TargetedExperiment.h:315
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:313
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
void setTransitions(std::vector< ReactionMonitoringTransition > &&transitions)
std::vector< Instrument > instruments_
Definition: TargetedExperiment.h:305
TargetedExperimentHelper::Publication Publication
Definition: TargetedExperiment.h:85
void setPeptides(std::vector< Peptide > &&rhs)
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:319
void setCompounds(const std::vector< Compound > &rhs)
ProteinReferenceMapType protein_reference_map_
Definition: TargetedExperiment.h:325
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:321
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:311
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:317
std::vector< Publication > publications_
Definition: TargetedExperiment.h:303
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:327
std::map< String, const Peptide * > PeptideReferenceMapType
Definition: TargetedExperiment.h:93
std::vector< Software > software_
Definition: TargetedExperiment.h:309
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:329
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:333
Size protein_count
Definition: TargetedExperiment.h:70
void addContact(const Contact &contact)
bool peptide_reference_map_dirty_
Definition: TargetedExperiment.h:331
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