Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
MzQuantMLHandler.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-2017.
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 #ifndef OPENMS_FORMAT_HANDLERS_MZQUANTMLHANDLER_H
36 #define OPENMS_FORMAT_HANDLERS_MZQUANTMLHANDLER_H
37 
41 
42 namespace OpenMS
43 {
44  class ProgressLogger;
45 
46  namespace Internal
47  {
48 
54  class OPENMS_DLLAPI MzQuantMLHandler :
55  public XMLHandler
56  {
57 public:
60  MzQuantMLHandler(const MSQuantifications & msq, const String & filename, const String & version, const ProgressLogger & logger);
62 
64  MzQuantMLHandler(MSQuantifications & msq, const String & filename, const String & version, const ProgressLogger & logger);
65 
67  virtual ~MzQuantMLHandler();
69 
70 
71  // Docu in base class
72  virtual void endElement(const XMLCh * const /*uri*/, const XMLCh * const /*local_name*/, const XMLCh * const qname);
73 
74  // Docu in base class
75  virtual void startElement(const XMLCh * const /*uri*/, const XMLCh * const /*local_name*/, const XMLCh * const qname, const xercesc::Attributes & attributes);
76 
77  // Docu in base class
78  virtual void characters(const XMLCh * const chars, const XMLSize_t length);
79 
80  //Docu in base class
81  virtual void writeTo(std::ostream & os);
82 
83 protected:
84 
87 
90 
92 
94 
96 
98  void handleCVParam_(const String & parent_parent_tag, const String & parent_tag, const String & accession, const String & name, const String & value, const xercesc::Attributes & attributes, const String & cv_ref, const String & unit_accession = "");
99 
101  void handleUserParam_(const String & parent_parent_tag, const String & parent_tag, const String & name, const String & type, const String & value);
102 
104  //~ TODO rewirte writeCVParams_ in baseclass to be more convenient
105  //~ void MzQuantMLHandler::writeCVParams_(std::ostream& os, const Map< String, std::vector < CVTerm > > & , UInt indent);
106  void writeCVParams_(String & s, const Map<String, std::vector<CVTerm> > &, UInt indent);
107 
109  void writeUserParams_(std::ostream & os, const MetaInfoInterface & meta, UInt indent);
110  void writeUserParams_(String & s, const MetaInfoInterface & meta, UInt indent);
111 
113  ControlledVocabulary::CVTerm getChildWithName_(const String & parent_accession, const String & name) const;
114 
115 
117  void writeFeature_(String & feature_xml, const std::vector<FeatureMap >& fm, UInt indentation_level);
118 
120  //void writeSourceFile_(std::ostream& os, const String& id, const SourceFile& software);
121 
122 
123 private:
125  MzQuantMLHandler(const MzQuantMLHandler & rhs);
126  MzQuantMLHandler & operator=(const MzQuantMLHandler & rhs);
127 
128  std::map<String, std::vector<ExperimentalSettings> > current_files_; // 1.rawfilesgroup_ref 2.inputfiles for each assay as ExperimentalSettings
132 
133  std::vector<MetaInfo> up_stack_;
134  std::vector<CVTerm> cvp_stack_;
136 
137  std::multimap<String, String> cm_cf_ids_;
138  std::map<String, String> f_cf_ids_;
139  std::map<String, ConsensusFeature> cf_cf_obj_;
140  std::map<String, FeatureHandle> f_f_obj_;
141  std::map<String, ConsensusFeature::Ratio> r_rtemp_;
142  std::map<String, String> numden_r_ids_;
143  std::map<String, ConsensusFeature::Ratio> r_r_obj_;
144 
145  //~ Software current_sw_;
146  std::map<String, Software> current_sws_;
147  std::map<int, DataProcessing> current_orderedps_;
148  std::pair<int, DataProcessing> current_dp_;
149  std::set<DataProcessing::ProcessingAction> current_pas_;
150 
151  std::vector<String> current_col_types_;
152  std::vector<double> current_dm_values_;
153  std::vector<double> current_row_;
154 
155  };
156  } // namespace Internal
157 } // namespace OpenMS
158 
159 #endif
String current_id_
Definition: MzQuantMLHandler.h:129
Representation of a CV term.
Definition: ControlledVocabulary.h:61
A more convenient string class.
Definition: String.h:57
std::set< DataProcessing::ProcessingAction > current_pas_
Definition: MzQuantMLHandler.h:149
const ProgressLogger & logger_
Progress logger.
Definition: MzQuantMLHandler.h:86
std::map< String, ConsensusFeature > cf_cf_obj_
Definition: MzQuantMLHandler.h:139
std::vector< CVTerm > cvp_stack_
Definition: MzQuantMLHandler.h:134
Definition: MSQuantifications.h:128
std::map< String, Software > current_sws_
Definition: MzQuantMLHandler.h:146
const MSQuantifications * cmsq_
Definition: MzQuantMLHandler.h:95
unsigned int UInt
Unsigned integer type.
Definition: Types.h:95
std::map< int, DataProcessing > current_orderedps_
Definition: MzQuantMLHandler.h:147
Base class for XML handlers.
Definition: XMLHandler.h:110
XML handler for MzQuantMLFile.
Definition: MzQuantMLHandler.h:54
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
std::map< String, String > numden_r_ids_
Definition: MzQuantMLHandler.h:142
std::vector< double > current_dm_values_
Definition: MzQuantMLHandler.h:152
Representation of a controlled vocabulary.
Definition: ControlledVocabulary.h:55
std::pair< int, DataProcessing > current_dp_
Definition: MzQuantMLHandler.h:148
std::vector< String > current_col_types_
Definition: MzQuantMLHandler.h:151
String current_cf_id_
Definition: MzQuantMLHandler.h:130
Definition: MSQuantifications.h:52
Size current_count_
Definition: MzQuantMLHandler.h:131
std::vector< double > current_row_
Definition: MzQuantMLHandler.h:153
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition: MetaInfoInterface.h:56
std::map< String, FeatureHandle > f_f_obj_
Definition: MzQuantMLHandler.h:140
MSQuantifications::Assay current_assay_
Definition: MzQuantMLHandler.h:135
std::map< String, String > f_cf_ids_
Definition: MzQuantMLHandler.h:138
std::vector< MetaInfo > up_stack_
Definition: MzQuantMLHandler.h:133
std::map< String, ConsensusFeature::Ratio > r_rtemp_
Definition: MzQuantMLHandler.h:141
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:55
std::multimap< String, String > cm_cf_ids_
Definition: MzQuantMLHandler.h:137
ControlledVocabulary cv_
Controlled vocabulary (hopefully the psi-pi from OpenMS/share/OpenMS/CV/psi-pi.obo) ...
Definition: MzQuantMLHandler.h:89
std::map< String, ConsensusFeature::Ratio > r_r_obj_
Definition: MzQuantMLHandler.h:143
String tag_
Definition: MzQuantMLHandler.h:91
MSQuantifications * msq_
Definition: MzQuantMLHandler.h:93
Map class based on the STL map (containing several convenience functions)
Definition: Map.h:51
std::map< String, std::vector< ExperimentalSettings > > current_files_
Definition: MzQuantMLHandler.h:128

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:02 using doxygen 1.8.13