OpenMS
TargetedExperiment.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Hannes Roest $
6 // $Authors: Andreas Bertsch $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
14 #include <OpenMS/METADATA/CVTerm.h>
19 
20 #include <vector>
21 
22 namespace OpenMS
23 {
38  class OPENMS_DLLAPI TargetedExperiment
39  {
40 public:
41 
42  struct OPENMS_DLLAPI SummaryStatistics
43  {
48  std::map<ReactionMonitoringTransition::DecoyTransitionType, size_t> decoy_counts;
50  };
51 
52 
64  typedef Residue IonType; // IonType enum of Interpretation class
65 
66  typedef std::map<String, const Protein *> ProteinReferenceMapType;
67  typedef std::map<String, const Peptide *> PeptideReferenceMapType;
68  typedef std::map<String, const Compound *> CompoundReferenceMapType;
69 
75 
78 
81 
85 
88 
91 
95  bool operator==(const TargetedExperiment & rhs) const;
96 
97  bool operator!=(const TargetedExperiment & rhs) const;
99 
106 
114 
120  void clear(bool clear_meta_data);
121 
124 
128  // cv list
129  void setCVs(const std::vector<CV> & cvs);
130 
131  const std::vector<CV> & getCVs() const;
132 
133  void addCV(const CV & cv);
134 
135  // contact list
136  void setContacts(const std::vector<Contact> & contacts);
137 
138  const std::vector<Contact> & getContacts() const;
139 
140  void addContact(const Contact & contact);
141 
142  // publication list
143  void setPublications(const std::vector<Publication> & publications);
144 
145  const std::vector<Publication> & getPublications() const;
146 
147  void addPublication(const Publication & publication);
148 
149  // target list
150  void setTargetCVTerms(const CVTermList & cv_terms);
151 
152  const CVTermList & getTargetCVTerms() const;
153 
154  void addTargetCVTerm(const CVTerm & cv_term);
155 
156  void setTargetMetaValue(const String & name, const DataValue & value);
157 
158  // instrument list
159  void setInstruments(const std::vector<Instrument> & instruments);
160 
161  const std::vector<Instrument> & getInstruments() const;
162 
163  void addInstrument(const Instrument & instrument);
164 
165  // software list
166  void setSoftware(const std::vector<Software> & software);
167 
168  const std::vector<Software> & getSoftware() const;
169 
170  void addSoftware(const Software & software);
171 
172  // protein list
173  void setProteins(const std::vector<Protein> & proteins);
174  void setProteins(std::vector<Protein> && proteins);
175 
176  const std::vector<Protein> & getProteins() const;
177 
178  const Protein & getProteinByRef(const String & ref) const;
179 
180  bool hasProtein(const String & ref) const;
181 
182  void addProtein(const Protein & protein);
183 
184  // compound list
185  void setCompounds(const std::vector<Compound> & rhs);
186 
187  const std::vector<Compound> & getCompounds() const;
188 
189  void addCompound(const Compound & rhs);
190 
191  void setPeptides(const std::vector<Peptide> & rhs);
192  void setPeptides(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  void setTransitions(std::vector<ReactionMonitoringTransition> && transitions);
209 
211  const std::vector<ReactionMonitoringTransition> & getTransitions() const;
212 
214  void addTransition(const ReactionMonitoringTransition & transition);
215 
216  void setIncludeTargets(const std::vector<IncludeExcludeTarget> & targets);
217 
218  const std::vector<IncludeExcludeTarget> & getIncludeTargets() const;
219 
221 
222  void setExcludeTargets(const std::vector<IncludeExcludeTarget> & targets);
223 
224  const std::vector<IncludeExcludeTarget> & getExcludeTargets() const;
225 
227 
229  void setSourceFiles(const std::vector<SourceFile> & source_files);
230 
232  const std::vector<SourceFile> & getSourceFiles() const;
233 
235  void addSourceFile(const SourceFile & source_file);
237 
239 
240 
245 
247 
248 
253 
264 
265 protected:
266 
268 
270 
272 
273  std::vector<CV> cvs_;
274 
275  std::vector<Contact> contacts_;
276 
277  std::vector<Publication> publications_;
278 
279  std::vector<Instrument> instruments_;
280 
282 
283  std::vector<Software> software_;
284 
285  std::vector<Protein> proteins_;
286 
287  std::vector<Compound> compounds_;
288 
289  std::vector<Peptide> peptides_;
290 
291  std::vector<ReactionMonitoringTransition> transitions_;
292 
293  std::vector<IncludeExcludeTarget> include_targets_;
294 
295  std::vector<IncludeExcludeTarget> exclude_targets_;
296 
297  std::vector<SourceFile> source_files_;
298 
300 
302 
304 
306 
308 
310 
311  };
312 
313  namespace TargetedExperimentHelper
314  {
315  } // namespace TargetedExperimentHelper
316 
318  OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const TargetedExperiment::SummaryStatistics& s);
319 
320 
321 } // namespace OpenMS
322 
Representation of controlled vocabulary term list.
Definition: CVTermList.h:28
Representation of controlled vocabulary term.
Definition: CVTerm.h:27
Class to hold strings, numeric values, lists of strings and lists of numeric values.
Definition: DataValue.h:33
This class stores a SRM/MRM transition.
Definition: IncludeExcludeTarget.h:28
This class stores a SRM/MRM transition.
Definition: ReactionMonitoringTransition.h:32
Representation of an amino acid residue.
Definition: Residue.h:37
Description of the software used for processing.
Definition: Software.h:24
Description of a file location, used to store the origin of (meta) data.
Definition: SourceFile.h:22
A more convenient string class.
Definition: String.h:34
Represents a compound (small molecule)
Definition: TargetedExperimentHelper.h:296
Represents a peptide (amino acid sequence)
Definition: TargetedExperimentHelper.h:333
This class stores a retention time structure that is used in TargetedExperiment (representing a TraML...
Definition: TargetedExperimentHelper.h:99
A description of a targeted experiment containing precursor and production ions.
Definition: TargetedExperiment.h:39
std::map< String, const Protein * > ProteinReferenceMapType
Definition: TargetedExperiment.h:66
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:275
const std::vector< Peptide > & getPeptides() const
const Protein & getProteinByRef(const String &ref) const
CVTermList targets_
Definition: TargetedExperiment.h:281
bool compound_reference_map_dirty_
Definition: TargetedExperiment.h:309
TargetedExperiment(const TargetedExperiment &rhs)
copy constructor
TargetedExperimentHelper::Interpretation Interpretation
Definition: TargetedExperiment.h:62
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:64
TargetedExperiment(TargetedExperiment &&rhs) noexcept
move constructor
Size transition_count
Definition: TargetedExperiment.h:47
TargetedExperiment()
default constructor
const std::vector< Software > & getSoftware() const
const Compound & getCompoundByRef(const String &ref) const
TargetedExperimentHelper::Instrument Instrument
Definition: TargetedExperiment.h:60
TargetedExperiment & operator+=(TargetedExperiment &&rhs)
std::vector< CV > cvs_
Definition: TargetedExperiment.h:273
void addPeptide(const Peptide &rhs)
Size peptide_count
Definition: TargetedExperiment.h:45
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:61
const std::vector< Publication > & getPublications() const
ReactionMonitoringTransition Transition
Definition: TargetedExperiment.h:63
TargetedExperimentHelper::Protein Protein
Definition: TargetedExperiment.h:54
std::vector< SourceFile > source_files_
Definition: TargetedExperiment.h:297
void setTargetMetaValue(const String &name, const DataValue &value)
std::vector< Peptide > peptides_
Definition: TargetedExperiment.h:289
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:287
const std::vector< Instrument > & getInstruments() const
TargetedExperiment operator+(const TargetedExperiment &rhs) const
Joins two targeted experiments.
TargetedExperimentHelper::Contact Contact
Definition: TargetedExperiment.h:58
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:279
TargetedExperimentHelper::Publication Publication
Definition: TargetedExperiment.h:59
void setPeptides(std::vector< Peptide > &&rhs)
std::map< ReactionMonitoringTransition::DecoyTransitionType, size_t > decoy_counts
Definition: TargetedExperiment.h:48
const std::vector< Contact > & getContacts() const
void addTargetCVTerm(const CVTerm &cv_term)
std::vector< IncludeExcludeTarget > include_targets_
Definition: TargetedExperiment.h:293
void setCompounds(const std::vector< Compound > &rhs)
ProteinReferenceMapType protein_reference_map_
Definition: TargetedExperiment.h:299
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:46
std::vector< IncludeExcludeTarget > exclude_targets_
Definition: TargetedExperiment.h:295
void addExcludeTarget(const IncludeExcludeTarget &target)
TargetedExperimentHelper::Peptide Peptide
Definition: TargetedExperiment.h:57
void addProtein(const Protein &protein)
void addCompound(const Compound &rhs)
std::vector< Protein > proteins_
Definition: TargetedExperiment.h:285
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:291
std::vector< Publication > publications_
Definition: TargetedExperiment.h:277
void sortTransitionsByProductMZ()
Lexicographically sorts the transitions by their product m/z.
TargetedExperimentHelper::CV CV
Definition: TargetedExperiment.h:53
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:301
std::map< String, const Peptide * > PeptideReferenceMapType
Definition: TargetedExperiment.h:67
std::vector< Software > software_
Definition: TargetedExperiment.h:283
std::map< String, const Compound * > CompoundReferenceMapType
Definition: TargetedExperiment.h:68
TargetedExperimentHelper::Compound Compound
Definition: TargetedExperiment.h:56
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:303
void setInstruments(const std::vector< Instrument > &instruments)
bool contains_invalid_references
Definition: TargetedExperiment.h:49
void addPublication(const Publication &publication)
void createProteinReferenceMap_() const
TargetedExperiment & operator=(const TargetedExperiment &rhs)
assignment operator
virtual ~TargetedExperiment()
destructor
TargetedExperimentHelper::RetentionTime RetentionTime
Definition: TargetedExperiment.h:55
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:307
Size protein_count
Definition: TargetedExperiment.h:44
void addContact(const Contact &contact)
bool peptide_reference_map_dirty_
Definition: TargetedExperiment.h:305
Definition: TargetedExperiment.h:43
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
Definition: TargetedExperimentHelper.h:46
Definition: TargetedExperimentHelper.h:402
Definition: TargetedExperimentHelper.h:436
Product ion interpretation.
Definition: TargetedExperimentHelper.h:478
Definition: TargetedExperimentHelper.h:453
Definition: TargetedExperimentHelper.h:73
Definition: TargetedExperimentHelper.h:419