OpenMS  2.4.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-2018.
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>
45 
46 #include <vector>
47 #include <map>
48 
49 namespace OpenMS
50 {
51  class OPENMS_DLLAPI MSQuantifications :
53  {
54 public:
56 
57  typedef CVTermList ParamGroupList; // userparams are exclusively inside the CVTermList's MetaInfoInterface
59 
60  enum QUANT_TYPES {MS1LABEL = 0, MS2LABEL, LABELFREE, SIZE_OF_QUANT_TYPES}; // derived from processing applied
61  static const std::string NamesOfQuantTypes[SIZE_OF_QUANT_TYPES];
62 
64  //~ InputFiles: //~ searchdb abbildung version,releasedate,#entries,dbname ber paramgrouplist
65  //~ struct ParamGroupList
66  //~ {
67  //~ ParamGroupList()
68  //~ {
69  //~ }
70 
71  //~ ParamGroupList(const ParamGroupList& rhs)
72  //~ : cv_params(rhs.cv_params)
73  //~ {
74  //~ }
75 
76  //~ ~ParamGroupList()
77  //~ {
78  //~ }
79 
80  //~ ParamGroupList& operator = (const ParamGroupList& rhs)
81  //~ {
82  //~ if (&rhs != this)
83  //~ {
84  //~ cv_params = rhs.cv_params;
85  //~ user_params = rhs.user_params;
86  //~ }
87  //~ return *this;
88  //~ }
89 
90  //~ MetaInfoInterface user_params;
91  //~ CVTermList cv_params;
92  //~ };
93 
95  {
97  {
98  }
99 
101  cv_params_(rhs.cv_params_)
102  {
103  user_params_ = rhs.user_params_;
104  quant_type_ = rhs.quant_type_;
105  }
106 
108  {
109  }
110 
112  {
113  if (&rhs != this)
114  {
115  cv_params_ = rhs.cv_params_;
116  user_params_ = rhs.user_params_;
117  quant_type_ = rhs.quant_type_;
118  }
119  return *this;
120  }
121 
125  };
126 
127  struct Assay
128  {
129  //TODO feature_maps_ also in Assay?! srsly?!
131  {
132  }
133 
134  Assay(const Assay & rhs)
135  {
136  uid_ = rhs.uid_;
137  mods_ = rhs.mods_;
138  raw_files_ = rhs.raw_files_;
139  feature_maps_ = rhs.feature_maps_;
140  }
141 
142  virtual ~Assay()
143  {
144  }
145 
146  Assay & operator=(const Assay & rhs)
147  {
148  if (&rhs != this)
149  {
150  uid_ = rhs.uid_;
151  mods_ = rhs.mods_;
152  raw_files_ = rhs.raw_files_;
153  feature_maps_ = rhs.feature_maps_;
154  }
155  return *this;
156  }
157 
159  std::vector<std::pair<String, double> > mods_;
160  std::vector<ExperimentalSettings> raw_files_;
161  std::map<size_t, FeatureMap > feature_maps_; // iTRAQ needs no FeatureMaps so ExperimentalSettings are not directly mapped to FeatureMaps
162  };
163 
164  // TODO handle referencing from consensusmaps to featuremaps/rawfiles
165  // TODO add ContactPerson or something to (Consensus)FeatureMap or DataProcessing (see below)
166  // 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
167  //~ if(DataProcessing::NamesOfProcessingAction[*it] == String("Quantitation"))
168  //~ {
169  //~ if (processing.getSoftware().getName()==String("SILACAnalyzer"))
170  //~ {
171  //~ experiment_type = MS1LABEL;
172  //~ }
173  //~ else if (processing.getSoftware().getName()==String("ITRAQAnalyzer"))
174  //~ {
175  //~ experiment_type = MS2LABEL;
176  //~ }
177  //~ else
178  //~ {
179  //~ experiment_type = LABELFREE;
180  //~ }
181  //~ }
182  //~ QUANT_TYPES experiment_type = MS1LABEL;
183 
186 
188  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> > >()));
189 
191  ~MSQuantifications() override;
192 
194  MSQuantifications(const MSQuantifications & source);
195 
197  MSQuantifications & operator=(const MSQuantifications & source);
198 
200  bool operator==(const MSQuantifications & rhs) const;
201 
203  bool operator!=(const MSQuantifications & rhs) const;
204 
218  // void load(const String & filename, bool trim_lines = false, Int first_n = -1);
219 
220  const std::vector<DataProcessing> getDataProcessingList() const;
221  const std::vector<Assay> & getAssays() const;
222  std::vector<Assay> & getAssays();
223  // std::map<String, ConsensusFeature::Ratio> & getRatios(); // TODO : implement
224  const std::vector<ConsensusMap> & getConsensusMaps() const;
225  std::vector<ConsensusMap> & getConsensusMaps();
226  void setConsensusMaps(const std::vector<ConsensusMap> & );
227  const std::vector<FeatureMap > & getFeatureMaps() const;
228  const AnalysisSummary & getAnalysisSummary() const;
229  AnalysisSummary & getAnalysisSummary();
230  void setDataProcessingList(std::vector<DataProcessing> & dpl);
231  void setAnalysisSummaryQuantType(QUANT_TYPES r);
232  void addConsensusMap(ConsensusMap & m);
233  void assignUIDs();
234  void registerExperiment(PeakMap & exp, std::vector<std::vector<std::pair<String, double> > > labels);
235  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> > >()));
236 
237 private:
239  std::vector<MetaInfo> bibliographic_reference_;
240  std::vector<ConsensusMap> consensus_maps_;
241  std::vector<FeatureMap > feature_maps_;
242  std::vector<Assay> assays_;
243  std::vector<DataProcessing> data_processings_;
244  //~ std::map<String,ConsensusFeature::Ratio > ratio_calculations_;
245  };
246 
247 } // namespace OpenMS
248 
Assay(const Assay &rhs)
Definition: MSQuantifications.h:134
A more convenient string class.
Definition: String.h:57
AnalysisSummary()
Definition: MSQuantifications.h:96
std::vector< ConsensusMap > consensus_maps_
Definition: MSQuantifications.h:240
Representation of controlled vocabulary term list.
Definition: CVTermList.h:52
CVTermList cv_params_
Definition: MSQuantifications.h:123
Definition: MSQuantifications.h:127
std::vector< DataProcessing > data_processings_
Definition: MSQuantifications.h:243
A container for features.
Definition: FeatureMap.h:93
A container for consensus elements.
Definition: ConsensusMap.h:75
bool operator==(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:806
String uid_
Definition: MSQuantifications.h:158
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
MetaInfo user_params_
Definition: MSQuantifications.h:122
AnalysisSummary & operator=(const AnalysisSummary &rhs)
Definition: MSQuantifications.h:111
QUANT_TYPES quant_type_
Definition: MSQuantifications.h:124
virtual ~AnalysisSummary()
Definition: MSQuantifications.h:107
std::vector< ExperimentalSettings > raw_files_
Definition: MSQuantifications.h:160
Definition: MSQuantifications.h:51
Assay()
Definition: MSQuantifications.h:130
AnalysisSummary analysis_summary_
Definition: MSQuantifications.h:238
std::vector< FeatureMap > feature_maps_
Definition: MSQuantifications.h:241
QUANT_TYPES
Definition: MSQuantifications.h:60
virtual ~Assay()
Definition: MSQuantifications.h:142
std::vector< Assay > assays_
Definition: MSQuantifications.h:242
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
bool operator!=(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:824
Definition: MSQuantifications.h:94
std::vector< MetaInfo > bibliographic_reference_
Definition: MSQuantifications.h:239
std::map< size_t, FeatureMap > feature_maps_
Definition: MSQuantifications.h:161
A Type-Name-Value tuple class.
Definition: MetaInfo.h:66
std::vector< std::pair< String, double > > mods_
Definition: MSQuantifications.h:159
Description of the experimental settings.
Definition: ExperimentalSettings.h:58
Assay & operator=(const Assay &rhs)
Definition: MSQuantifications.h:146
AnalysisSummary(const AnalysisSummary &rhs)
Definition: MSQuantifications.h:100