OpenMS  3.0.0
MSQuantifications.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: Mathias Walzer$
32 // $Authors: Mathias Walzer$
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
41 //~ #include <OpenMS/KERNEL/ConsensusFeature.h>
46 
47 #include <vector>
48 #include <map>
49 
50 namespace OpenMS
51 {
52  class OPENMS_DLLAPI MSQuantifications :
54  {
55 public:
57 
58  typedef CVTermList ParamGroupList; // userparams are exclusively inside the CVTermList's MetaInfoInterface
60 
61  enum QUANT_TYPES {MS1LABEL = 0, MS2LABEL, LABELFREE, SIZE_OF_QUANT_TYPES}; // derived from processing applied
62  static const std::string NamesOfQuantTypes[SIZE_OF_QUANT_TYPES];
63 
65  //~ InputFiles: //~ searchdb abbildung version,releasedate,#entries,dbname ber paramgrouplist
66  //~ struct ParamGroupList
67  //~ {
68  //~ ParamGroupList()
69  //~ {
70  //~ }
71 
72  //~ ParamGroupList(const ParamGroupList& rhs)
73  //~ : cv_params(rhs.cv_params)
74  //~ {
75  //~ }
76 
77  //~ ~ParamGroupList()
78  //~ {
79  //~ }
80 
81  //~ ParamGroupList& operator = (const ParamGroupList& rhs)
82  //~ {
83  //~ if (&rhs != this)
84  //~ {
85  //~ cv_params = rhs.cv_params;
86  //~ user_params = rhs.user_params;
87  //~ }
88  //~ return *this;
89  //~ }
90 
91  //~ MetaInfoInterface user_params;
92  //~ CVTermList cv_params;
93  //~ };
94 
96  {
98  {
99  }
100 
102  cv_params_(rhs.cv_params_)
103  {
104  user_params_ = rhs.user_params_;
105  quant_type_ = rhs.quant_type_;
106  }
107 
109  {
110  }
111 
113  {
114  if (&rhs != this)
115  {
116  cv_params_ = rhs.cv_params_;
117  user_params_ = rhs.user_params_;
118  quant_type_ = rhs.quant_type_;
119  }
120  return *this;
121  }
122 
126  };
127 
128  struct Assay
129  {
130  //TODO feature_maps_ also in Assay?! srsly?!
132  {
133  }
134 
135  Assay(const Assay & rhs)
136  {
137  uid_ = rhs.uid_;
138  mods_ = rhs.mods_;
139  raw_files_ = rhs.raw_files_;
140  feature_maps_ = rhs.feature_maps_;
141  }
142 
143  virtual ~Assay()
144  {
145  }
146 
147  Assay & operator=(const Assay & rhs)
148  {
149  if (&rhs != this)
150  {
151  uid_ = rhs.uid_;
152  mods_ = rhs.mods_;
153  raw_files_ = rhs.raw_files_;
154  feature_maps_ = rhs.feature_maps_;
155  }
156  return *this;
157  }
158 
160  std::vector<std::pair<String, double> > mods_;
161  std::vector<ExperimentalSettings> raw_files_;
162  std::map<size_t, FeatureMap > feature_maps_; // iTRAQ needs no FeatureMaps so ExperimentalSettings are not directly mapped to FeatureMaps
163  };
164 
165  // TODO handle referencing from consensusmaps to featuremaps/rawfiles
166  // TODO add ContactPerson or something to (Consensus)FeatureMap or DataProcessing (see below)
167  // TODO rewrite OpenMS::DataProcessing - data not yet linked in openms core formats - below should go in analysissummary of MSQuantifications - input/output not possible to be carried along
168  //~ if(DataProcessing::NamesOfProcessingAction[*it] == String("Quantitation"))
169  //~ {
170  //~ if (processing.getSoftware().getName()==String("SILACAnalyzer"))
171  //~ {
172  //~ experiment_type = MS1LABEL;
173  //~ }
174  //~ else if (processing.getSoftware().getName()==String("ITRAQAnalyzer"))
175  //~ {
176  //~ experiment_type = MS2LABEL;
177  //~ }
178  //~ else
179  //~ {
180  //~ experiment_type = LABELFREE;
181  //~ }
182  //~ }
183  //~ QUANT_TYPES experiment_type = MS1LABEL;
184 
186  MSQuantifications() = default;
187 
189  MSQuantifications(FeatureMap fm, ExperimentalSettings& es, std::vector<DataProcessing>& dps, std::vector<std::vector<std::pair<String, double> > > labels = (std::vector<std::vector<std::pair<String, double> > >()));
190 
192  MSQuantifications(const MSQuantifications & source) = default;
193 
196 
198  ~MSQuantifications() override;
199 
201  MSQuantifications & operator=(const MSQuantifications & source) = default;
202 
204  MSQuantifications& operator=(MSQuantifications&&) & = default;
205 
207  bool operator==(const MSQuantifications & rhs) const;
208 
210  bool operator!=(const MSQuantifications & rhs) const;
211 
225  // void load(const String & filename, bool trim_lines = false, Int first_n = -1);
226 
227  const std::vector<DataProcessing> getDataProcessingList() const;
228  const std::vector<Assay> & getAssays() const;
229  std::vector<Assay> & getAssays();
230  // std::map<String, ConsensusFeature::Ratio> & getRatios(); // TODO : implement
231  const std::vector<ConsensusMap> & getConsensusMaps() const;
232  std::vector<ConsensusMap> & getConsensusMaps();
233  void setConsensusMaps(const std::vector<ConsensusMap> & );
234  const std::vector<FeatureMap > & getFeatureMaps() const;
235  const AnalysisSummary & getAnalysisSummary() const;
236  AnalysisSummary & getAnalysisSummary();
237  void setDataProcessingList(std::vector<DataProcessing> & dpl);
238  void setAnalysisSummaryQuantType(QUANT_TYPES r);
239  void addConsensusMap(ConsensusMap & m);
240  void assignUIDs();
241  void registerExperiment(PeakMap & exp, std::vector<std::vector<std::pair<String, double> > > labels);
242  void registerExperiment(ExperimentalSettings & es, std::vector<DataProcessing>& dp, std::vector<std::vector<std::pair<String, double> > > labels = (std::vector<std::vector<std::pair<String, double> > >()));
243 
244 private:
246  std::vector<MetaInfo> bibliographic_reference_;
247  std::vector<ConsensusMap> consensus_maps_;
248  std::vector<FeatureMap > feature_maps_;
249  std::vector<Assay> assays_;
250  std::vector<DataProcessing> data_processings_;
251  //~ std::map<String,ConsensusFeature::Ratio > ratio_calculations_;
252  };
253 
254 } // namespace OpenMS
255 
OpenMS::MSQuantifications::Assay::operator=
Assay & operator=(const Assay &rhs)
Definition: MSQuantifications.h:147
OpenMS::MSQuantifications::AnalysisSummary::cv_params_
CVTermList cv_params_
Definition: MSQuantifications.h:124
OpenMS::MSQuantifications::Assay
Definition: MSQuantifications.h:128
OpenMS::MSQuantifications::Assay::raw_files_
std::vector< ExperimentalSettings > raw_files_
Definition: MSQuantifications.h:161
OpenMS::MSQuantifications::Assay::~Assay
virtual ~Assay()
Definition: MSQuantifications.h:143
OpenMS::MSQuantifications::Assay::feature_maps_
std::map< size_t, FeatureMap > feature_maps_
Definition: MSQuantifications.h:162
OpenMS::ExperimentalSettings
Description of the experimental settings.
Definition: ExperimentalSettings.h:59
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::MSQuantifications::Assay::mods_
std::vector< std::pair< String, double > > mods_
Definition: MSQuantifications.h:160
ConsensusMap.h
OpenMS::MSQuantifications::AnalysisSummary
Definition: MSQuantifications.h:95
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:70
OpenMS::MSQuantifications::AnalysisSummary::AnalysisSummary
AnalysisSummary()
Definition: MSQuantifications.h:97
OpenMS::MSQuantifications::AnalysisSummary::~AnalysisSummary
virtual ~AnalysisSummary()
Definition: MSQuantifications.h:108
OpenMS::MSQuantifications::Assay::uid_
String uid_
Definition: MSQuantifications.h:159
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::MSQuantifications::Assay::Assay
Assay()
Definition: MSQuantifications.h:131
DataProcessing.h
Exception.h
OpenMS::MSQuantifications::AnalysisSummary::user_params_
MetaInfo user_params_
Definition: MSQuantifications.h:123
OpenMS::MSQuantifications::bibliographic_reference_
std::vector< MetaInfo > bibliographic_reference_
Definition: MSQuantifications.h:246
OpenMS::MSQuantifications::AnalysisSummary::quant_type_
QUANT_TYPES quant_type_
Definition: MSQuantifications.h:125
FeatureMap.h
OpenMS::MSQuantifications::AnalysisSummary::operator=
AnalysisSummary & operator=(const AnalysisSummary &rhs)
Definition: MSQuantifications.h:112
OpenMS::MSQuantifications::data_processings_
std::vector< DataProcessing > data_processings_
Definition: MSQuantifications.h:250
OpenMS::MetaInfo
A Type-Name-Value tuple class.
Definition: MetaInfo.h:68
OpenMS::ConsensusMap
A container for consensus elements.
Definition: ConsensusMap.h:82
OpenMS::MSQuantifications::QUANT_TYPES
QUANT_TYPES
Definition: MSQuantifications.h:61
OpenMS::CVTermList
Representation of controlled vocabulary term list.
Definition: CVTermList.h:52
ExperimentalSettings.h
OpenMS::MSQuantifications::assays_
std::vector< Assay > assays_
Definition: MSQuantifications.h:249
MSExperiment.h
OpenMS::MSQuantifications::Assay::Assay
Assay(const Assay &rhs)
Definition: MSQuantifications.h:135
OpenMS::FeatureMap
A container for features.
Definition: FeatureMap.h:98
OpenMS::Internal::operator==
bool operator==(const IDBoostGraph::ProteinGroup &lhs, const IDBoostGraph::ProteinGroup &rhs)
OpenMS::MSQuantifications::feature_maps_
std::vector< FeatureMap > feature_maps_
Definition: MSQuantifications.h:248
OpenMS::MSQuantifications::consensus_maps_
std::vector< ConsensusMap > consensus_maps_
Definition: MSQuantifications.h:247
OpenMS::MSQuantifications::analysis_summary_
AnalysisSummary analysis_summary_
Definition: MSQuantifications.h:245
MetaInfo.h
OpenMS::MSQuantifications
Definition: MSQuantifications.h:52
OpenMS::MSQuantifications::AnalysisSummary::AnalysisSummary
AnalysisSummary(const AnalysisSummary &rhs)
Definition: MSQuantifications.h:101
StandardTypes.h