OpenMS
MSQuantifications.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Mathias Walzer$
6 // $Authors: Mathias Walzer$
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
19 
20 #include <vector>
21 #include <map>
22 
23 namespace OpenMS
24 {
25  class OPENMS_DLLAPI MSQuantifications :
27  {
28 public:
30 
31  typedef CVTermList ParamGroupList; // userparams are exclusively inside the CVTermList's MetaInfoInterface
33 
34  enum QUANT_TYPES {MS1LABEL = 0, MS2LABEL, LABELFREE, SIZE_OF_QUANT_TYPES}; // derived from processing applied
35  static const std::string NamesOfQuantTypes[SIZE_OF_QUANT_TYPES];
36 
38  //~ InputFiles: //~ searchdb abbildung version,releasedate,#entries,dbname ber paramgrouplist
39  //~ struct ParamGroupList
40  //~ {
41  //~ ParamGroupList()
42  //~ {
43  //~ }
44 
45  //~ ParamGroupList(const ParamGroupList& rhs)
46  //~ : cv_params(rhs.cv_params)
47  //~ {
48  //~ }
49 
50  //~ ~ParamGroupList()
51  //~ {
52  //~ }
53 
54  //~ ParamGroupList& operator = (const ParamGroupList& rhs)
55  //~ {
56  //~ if (&rhs != this)
57  //~ {
58  //~ cv_params = rhs.cv_params;
59  //~ user_params = rhs.user_params;
60  //~ }
61  //~ return *this;
62  //~ }
63 
64  //~ MetaInfoInterface user_params;
65  //~ CVTermList cv_params;
66  //~ };
67 
69  {
70  AnalysisSummary() = default;
71 
72  AnalysisSummary(const AnalysisSummary& rhs) = default;
73 
74  virtual ~AnalysisSummary() = default;
75 
76  AnalysisSummary& operator=(const AnalysisSummary& rhs) = default;
77 
80  QUANT_TYPES quant_type_ = SIZE_OF_QUANT_TYPES;
81  };
82 
83  struct Assay
84  {
85  //TODO feature_maps_ also in Assay?! srsly?!
86  Assay() = default;
87 
88  Assay(const Assay& rhs) = default;
89 
90  virtual ~Assay() = default;
91 
92  Assay& operator=(const Assay& rhs) = default;
93 
95  std::vector<std::pair<String, double> > mods_;
96  std::vector<ExperimentalSettings> raw_files_;
97  std::map<size_t, FeatureMap > feature_maps_; // iTRAQ needs no FeatureMaps so ExperimentalSettings are not directly mapped to FeatureMaps
98  };
99 
100  // TODO handle referencing from consensusmaps to featuremaps/rawfiles
101  // TODO add ContactPerson or something to (Consensus)FeatureMap or DataProcessing (see below)
102  // 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
103  //~ if(DataProcessing::NamesOfProcessingAction[*it] == String("Quantitation"))
104  //~ {
105  //~ if (processing.getSoftware().getName()==String("SILACAnalyzer"))
106  //~ {
107  //~ experiment_type = MS1LABEL;
108  //~ }
109  //~ else if (processing.getSoftware().getName()==String("ITRAQAnalyzer"))
110  //~ {
111  //~ experiment_type = MS2LABEL;
112  //~ }
113  //~ else
114  //~ {
115  //~ experiment_type = LABELFREE;
116  //~ }
117  //~ }
118  //~ QUANT_TYPES experiment_type = MS1LABEL;
119 
121  MSQuantifications() = default;
122 
126  std::vector<DataProcessing>& dps, std::vector<std::vector<std::pair<String, double>>> labels = {});
127 
129  MSQuantifications(const MSQuantifications & source) = default;
130 
133 
135  ~MSQuantifications() override;
136 
138  MSQuantifications & operator=(const MSQuantifications & source) = default;
139 
142 
144  bool operator==(const MSQuantifications & rhs) const;
145 
147  bool operator!=(const MSQuantifications & rhs) const;
148 
162  // void load(const String & filename, bool trim_lines = false, Int first_n = -1);
163 
164  const std::vector<DataProcessing> getDataProcessingList() const;
165  const std::vector<Assay> & getAssays() const;
166  std::vector<Assay> & getAssays();
167  // std::map<String, ConsensusFeature::Ratio> & getRatios(); // TODO : implement
168  const std::vector<ConsensusMap> & getConsensusMaps() const;
169  std::vector<ConsensusMap> & getConsensusMaps();
170  void setConsensusMaps(const std::vector<ConsensusMap> & );
171  const std::vector<FeatureMap > & getFeatureMaps() const;
174  void setDataProcessingList(const std::vector<DataProcessing> & dpl);
177  void assignUIDs();
178  void registerExperiment(PeakMap & exp, std::vector<std::vector<std::pair<String, double> > > labels);
179  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> > >()));
180 
181 private:
183  std::vector<MetaInfo> bibliographic_reference_;
184  std::vector<ConsensusMap> consensus_maps_;
185  std::vector<FeatureMap > feature_maps_;
186  std::vector<Assay> assays_;
187  std::vector<DataProcessing> data_processings_;
188  //~ std::map<String,ConsensusFeature::Ratio > ratio_calculations_;
189  };
190 
191 } // namespace OpenMS
192 
Representation of controlled vocabulary term list.
Definition: CVTermList.h:28
A container for consensus elements.
Definition: ConsensusMap.h:66
Description of the experimental settings.
Definition: ExperimentalSettings.h:36
A container for features.
Definition: FeatureMap.h:80
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:46
Definition: MSQuantifications.h:27
MSQuantifications & operator=(MSQuantifications &&) &=default
Move assignment operator.
std::vector< ConsensusMap > & getConsensusMaps()
std::vector< ConsensusMap > consensus_maps_
Definition: MSQuantifications.h:184
const std::vector< Assay > & getAssays() const
~MSQuantifications() override
Destructor.
std::vector< MetaInfo > bibliographic_reference_
Definition: MSQuantifications.h:183
MSQuantifications(MSQuantifications &&)=default
Move constructor.
bool operator!=(const MSQuantifications &rhs) const
Equality operator.
const std::vector< FeatureMap > & getFeatureMaps() const
MSQuantifications(const MSQuantifications &source)=default
Copy constructor.
const AnalysisSummary & getAnalysisSummary() const
QUANT_TYPES
Definition: MSQuantifications.h:34
@ LABELFREE
Definition: MSQuantifications.h:34
void setAnalysisSummaryQuantType(QUANT_TYPES r)
MSQuantifications & operator=(const MSQuantifications &source)=default
Assignment operator.
bool operator==(const MSQuantifications &rhs) const
Equality operator.
AnalysisSummary & getAnalysisSummary()
MSQuantifications()=default
Constructor.
void registerExperiment(PeakMap &exp, std::vector< std::vector< std::pair< String, double > > > labels)
void setDataProcessingList(const std::vector< DataProcessing > &dpl)
std::vector< FeatureMap > feature_maps_
Definition: MSQuantifications.h:185
void setConsensusMaps(const std::vector< ConsensusMap > &)
AnalysisSummary analysis_summary_
Definition: MSQuantifications.h:182
void addConsensusMap(ConsensusMap &m)
std::vector< Assay > assays_
Definition: MSQuantifications.h:186
MSQuantifications(const FeatureMap &fm, ExperimentalSettings &es, std::vector< DataProcessing > &dps, std::vector< std::vector< std::pair< String, double >>> labels={})
Detailed Constructor.
std::vector< DataProcessing > data_processings_
Definition: MSQuantifications.h:187
std::vector< Assay > & getAssays()
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 > > >()))
const std::vector< ConsensusMap > & getConsensusMaps() const
const std::vector< DataProcessing > getDataProcessingList() const
Loads data from a text file.
A Type-Name-Value tuple class.
Definition: MetaInfo.h:43
A more convenient string class.
Definition: String.h:34
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
Definition: MSQuantifications.h:69
AnalysisSummary(const AnalysisSummary &rhs)=default
CVTermList cv_params_
Definition: MSQuantifications.h:79
MetaInfo user_params_
Definition: MSQuantifications.h:78
AnalysisSummary & operator=(const AnalysisSummary &rhs)=default
Definition: MSQuantifications.h:84
std::vector< std::pair< String, double > > mods_
Definition: MSQuantifications.h:95
std::vector< ExperimentalSettings > raw_files_
Definition: MSQuantifications.h:96
Assay & operator=(const Assay &rhs)=default
String uid_
Definition: MSQuantifications.h:94
std::map< size_t, FeatureMap > feature_maps_
Definition: MSQuantifications.h:97
Assay(const Assay &rhs)=default