OpenMS
Loading...
Searching...
No Matches
TargetedExperiment.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- 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
19
20#include <unordered_map>
21#include <vector>
22
23namespace OpenMS
24{
39 class OPENMS_DLLAPI TargetedExperiment
40 {
41public:
42
43 struct OPENMS_DLLAPI SummaryStatistics
44 {
49 std::map<ReactionMonitoringTransition::DecoyTransitionType, size_t> decoy_counts;
51 };
52
53
65 typedef Residue IonType; // IonType enum of Interpretation class
66
67 typedef std::unordered_map<String, const Protein *> ProteinReferenceMapType;
68 typedef std::unordered_map<String, const Peptide *> PeptideReferenceMapType;
69 typedef std::unordered_map<String, const Compound *> CompoundReferenceMapType;
70
76
79
82
86
89
92
96 bool operator==(const TargetedExperiment & rhs) const;
97
98 bool operator!=(const TargetedExperiment & rhs) const;
100
107
115
121 void clear(bool clear_meta_data);
122
125
129 // cv list
130 void setCVs(const std::vector<CV> & cvs);
131
132 const std::vector<CV> & getCVs() const;
133
134 void addCV(const CV & cv);
135
136 // contact list
137 void setContacts(const std::vector<Contact> & contacts);
138
139 const std::vector<Contact> & getContacts() const;
140
141 void addContact(const Contact & contact);
142
143 // publication list
144 void setPublications(const std::vector<Publication> & publications);
145
146 const std::vector<Publication> & getPublications() const;
147
148 void addPublication(const Publication & publication);
149
150 // target list
151 void setTargetCVTerms(const CVTermList & cv_terms);
152
154
155 void addTargetCVTerm(const CVTerm & cv_term);
156
157 void setTargetMetaValue(const String & name, const DataValue & value);
158
159 // instrument list
160 void setInstruments(const std::vector<Instrument> & instruments);
161
162 const std::vector<Instrument> & getInstruments() const;
163
164 void addInstrument(const Instrument & instrument);
165
166 // software list
167 void setSoftware(const std::vector<Software> & software);
168
169 const std::vector<Software> & getSoftware() const;
170
171 void addSoftware(const Software & software);
172
173 // protein list
174 void setProteins(const std::vector<Protein> & proteins);
175 void setProteins(std::vector<Protein> && proteins);
176
177 const std::vector<Protein> & getProteins() const;
178
179 const Protein & getProteinByRef(const String & ref) const;
180
181 bool hasProtein(const String & ref) const;
182
183 void addProtein(const Protein & protein);
184
185 // compound list
186 void setCompounds(const std::vector<Compound> & rhs);
187
188 const std::vector<Compound> & getCompounds() const;
189
190 void addCompound(const Compound & rhs);
191
192 void setPeptides(const std::vector<Peptide> & rhs);
193 void setPeptides(std::vector<Peptide> && rhs);
194
195 const std::vector<Peptide> & getPeptides() const;
196
197 bool hasPeptide(const String & ref) const;
198
199 const Peptide & getPeptideByRef(const String & ref) const;
200
201 bool hasCompound(const String & ref) const;
202
203 const Compound & getCompoundByRef(const String & ref) const;
204
205 void addPeptide(const Peptide & rhs);
206
208 void setTransitions(const std::vector<ReactionMonitoringTransition> & transitions);
209 void setTransitions(std::vector<ReactionMonitoringTransition> && transitions);
210
212 const std::vector<ReactionMonitoringTransition> & getTransitions() const;
213
216
217 void setIncludeTargets(const std::vector<IncludeExcludeTarget> & targets);
218
219 const std::vector<IncludeExcludeTarget> & getIncludeTargets() const;
220
222
223 void setExcludeTargets(const std::vector<IncludeExcludeTarget> & targets);
224
225 const std::vector<IncludeExcludeTarget> & getExcludeTargets() const;
226
228
230 void setSourceFiles(const std::vector<SourceFile> & source_files);
231
233 const std::vector<SourceFile> & getSourceFiles() const;
234
236 void addSourceFile(const SourceFile & source_file);
238
240
241
246
248
249
254
265
266protected:
267
269
271
273
274 std::vector<CV> cvs_;
275
276 std::vector<Contact> contacts_;
277
278 std::vector<Publication> publications_;
279
280 std::vector<Instrument> instruments_;
281
283
284 std::vector<Software> software_;
285
286 std::vector<Protein> proteins_;
287
288 std::vector<Compound> compounds_;
289
290 std::vector<Peptide> peptides_;
291
292 std::vector<ReactionMonitoringTransition> transitions_;
293
294 std::vector<IncludeExcludeTarget> include_targets_;
295
296 std::vector<IncludeExcludeTarget> exclude_targets_;
297
298 std::vector<SourceFile> source_files_;
299
301
303
305
307
309
311
312 };
313
314 namespace TargetedExperimentHelper
315 {
316 } // namespace TargetedExperimentHelper
317
319 OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const TargetedExperiment::SummaryStatistics& s);
320
321
322} // namespace OpenMS
323
Representation of controlled vocabulary term list.
Definition CVTermList.h:29
Representation of controlled vocabulary term.
Definition CVTerm.h:28
Class to hold strings, numeric values, lists of strings and lists of numeric values.
Definition DataValue.h:34
This class stores a SRM/MRM transition.
Definition IncludeExcludeTarget.h:30
This class stores a SRM/MRM transition.
Definition ReactionMonitoringTransition.h:34
Representation of an amino acid residue.
Definition Residue.h:40
Description of the software used for processing.
Definition Software.h:26
Description of a file location, used to store the origin of (meta) data.
Definition SourceFile.h:23
A more convenient string class.
Definition String.h:34
Represents a compound (small molecule)
Definition TargetedExperimentHelper.h:298
Represents a peptide (amino acid sequence)
Definition TargetedExperimentHelper.h:335
This class stores a retention time structure that is used in TargetedExperiment (representing a TraML...
Definition TargetedExperimentHelper.h:101
A description of a targeted experiment containing precursor and production ions.
Definition TargetedExperiment.h:40
void setContacts(const std::vector< Contact > &contacts)
void setCVs(const std::vector< CV > &cvs)
TargetedExperiment & operator=(TargetedExperiment &&rhs) noexcept
move assignment operator
const Compound & getCompoundByRef(const String &ref) const
const std::vector< IncludeExcludeTarget > & getIncludeTargets() const
const CVTermList & getTargetCVTerms() const
const std::vector< Software > & getSoftware() const
bool operator==(const TargetedExperiment &rhs) const
void createCompoundReferenceMap_() const
std::vector< Contact > contacts_
Definition TargetedExperiment.h:276
CVTermList targets_
Definition TargetedExperiment.h:282
bool compound_reference_map_dirty_
Definition TargetedExperiment.h:310
TargetedExperiment(const TargetedExperiment &rhs)
copy constructor
TargetedExperiment & operator+=(TargetedExperiment &&rhs)
const std::vector< Instrument > & getInstruments() const
TargetedExperimentHelper::Interpretation Interpretation
Definition TargetedExperiment.h:63
void setPeptides(const std::vector< Peptide > &rhs)
const std::vector< SourceFile > & getSourceFiles() const
returns the source file list
const std::vector< CV > & getCVs() const
void setExcludeTargets(const std::vector< IncludeExcludeTarget > &targets)
const Protein & getProteinByRef(const String &ref) const
void addInstrument(const Instrument &instrument)
Residue IonType
Definition TargetedExperiment.h:65
TargetedExperiment(TargetedExperiment &&rhs) noexcept
move constructor
Size transition_count
Definition TargetedExperiment.h:48
TargetedExperiment()
default constructor
TargetedExperimentHelper::Instrument Instrument
Definition TargetedExperiment.h:61
std::vector< CV > cvs_
Definition TargetedExperiment.h:274
void addPeptide(const Peptide &rhs)
Size peptide_count
Definition TargetedExperiment.h:46
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:62
ReactionMonitoringTransition Transition
Definition TargetedExperiment.h:64
TargetedExperimentHelper::Protein Protein
Definition TargetedExperiment.h:55
std::vector< SourceFile > source_files_
Definition TargetedExperiment.h:298
void setTargetMetaValue(const String &name, const DataValue &value)
std::vector< Peptide > peptides_
Definition TargetedExperiment.h:290
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:288
const std::vector< Publication > & getPublications() const
const std::vector< IncludeExcludeTarget > & getExcludeTargets() const
TargetedExperiment operator+(const TargetedExperiment &rhs) const
Joins two targeted experiments.
TargetedExperimentHelper::Contact Contact
Definition TargetedExperiment.h:59
SummaryStatistics getSummary() const
return summary stats about this TE.
void setTransitions(std::vector< ReactionMonitoringTransition > &&transitions)
std::vector< Instrument > instruments_
Definition TargetedExperiment.h:280
const Peptide & getPeptideByRef(const String &ref) const
TargetedExperimentHelper::Publication Publication
Definition TargetedExperiment.h:60
void setPeptides(std::vector< Peptide > &&rhs)
std::map< ReactionMonitoringTransition::DecoyTransitionType, size_t > decoy_counts
Definition TargetedExperiment.h:49
void addTargetCVTerm(const CVTerm &cv_term)
std::vector< IncludeExcludeTarget > include_targets_
Definition TargetedExperiment.h:294
void setCompounds(const std::vector< Compound > &rhs)
ProteinReferenceMapType protein_reference_map_
Definition TargetedExperiment.h:300
bool hasProtein(const String &ref) const
void addTransition(const ReactionMonitoringTransition &transition)
adds a transition to the list
Size compound_count
Definition TargetedExperiment.h:47
std::vector< IncludeExcludeTarget > exclude_targets_
Definition TargetedExperiment.h:296
void addExcludeTarget(const IncludeExcludeTarget &target)
TargetedExperimentHelper::Peptide Peptide
Definition TargetedExperiment.h:58
void addProtein(const Protein &protein)
void addCompound(const Compound &rhs)
std::vector< Protein > proteins_
Definition TargetedExperiment.h:286
void sortTransitionsByName()
Lexicographically sorts the transitions by their name.
const std::vector< Protein > & getProteins() const
const std::vector< Contact > & getContacts() const
std::vector< ReactionMonitoringTransition > transitions_
Definition TargetedExperiment.h:292
std::vector< Publication > publications_
Definition TargetedExperiment.h:278
void sortTransitionsByProductMZ()
Lexicographically sorts the transitions by their product m/z.
TargetedExperimentHelper::CV CV
Definition TargetedExperiment.h:54
bool hasCompound(const String &ref) const
bool hasPeptide(const String &ref) const
void addIncludeTarget(const IncludeExcludeTarget &target)
TargetedExperiment & operator+=(const TargetedExperiment &rhs)
Add one targeted experiment to another.
void setSoftware(const std::vector< Software > &software)
TargetedExperiment & operator=(const TargetedExperiment &rhs)
assignment operator
bool protein_reference_map_dirty_
Definition TargetedExperiment.h:302
std::unordered_map< String, const Peptide * > PeptideReferenceMapType
Definition TargetedExperiment.h:68
std::vector< Software > software_
Definition TargetedExperiment.h:284
TargetedExperimentHelper::Compound Compound
Definition TargetedExperiment.h:57
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:304
const std::vector< ReactionMonitoringTransition > & getTransitions() const
returns the transition list
void setInstruments(const std::vector< Instrument > &instruments)
bool contains_invalid_references
Definition TargetedExperiment.h:50
const std::vector< Compound > & getCompounds() const
std::unordered_map< String, const Compound * > CompoundReferenceMapType
Definition TargetedExperiment.h:69
void addPublication(const Publication &publication)
const std::vector< Peptide > & getPeptides() const
std::unordered_map< String, const Protein * > ProteinReferenceMapType
Definition TargetedExperiment.h:67
void createProteinReferenceMap_() const
virtual ~TargetedExperiment()
destructor
TargetedExperimentHelper::RetentionTime RetentionTime
Definition TargetedExperiment.h:56
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:308
Size protein_count
Definition TargetedExperiment.h:45
void addContact(const Contact &contact)
bool peptide_reference_map_dirty_
Definition TargetedExperiment.h:306
Definition TargetedExperiment.h:44
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:48
Definition TargetedExperimentHelper.h:404
Definition TargetedExperimentHelper.h:438
Product ion interpretation.
Definition TargetedExperimentHelper.h:480
Definition TargetedExperimentHelper.h:455
Definition TargetedExperimentHelper.h:75
Definition TargetedExperimentHelper.h:421