Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
TraMLHandler.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-2015.
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: Hannes Roest $
32 // $Authors: Andreas Bertsch, Hannes Roest $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_FORMAT_HANDLERS_TRAMLHANDLER_H
36 #define OPENMS_FORMAT_HANDLERS_TRAMLHANDLER_H
37 
43 
44 namespace OpenMS
45 {
46  namespace Internal
47  {
48 
54  class OPENMS_DLLAPI TraMLHandler :
55  public XMLHandler
56  {
57 public:
58 
59  typedef std::vector<ReactionMonitoringTransition::Product> ProductListType;
60  typedef std::vector<ReactionMonitoringTransition::Configuration> ConfigurationListType;
61 
64  TraMLHandler(const TargetedExperiment & exp, const String & filename, const String & version, const ProgressLogger & logger);
66 
68  TraMLHandler(TargetedExperiment & exp, const String & filename, const String & version, const ProgressLogger & logger);
69 
71  virtual ~TraMLHandler();
73 
74 
75  // Docu in base class
76  virtual void endElement(const XMLCh * const /*uri*/, const XMLCh * const /*local_name*/, const XMLCh * const qname);
77 
78  // Docu in base class
79  virtual void startElement(const XMLCh * const /*uri*/, const XMLCh * const /*local_name*/, const XMLCh * const qname, const xercesc::Attributes & attributes);
80 
81  // Docu in base class
82  virtual void characters(const XMLCh * const chars, const XMLSize_t length);
83 
84  //Docu in base class
85  virtual void writeTo(std::ostream & os);
86 
87 protected:
88 
91 
94 
96 
98 
100 
102 
104 
106 
108 
110 
112 
114 
116 
118 
120 
122 
124 
126 
127  std::vector<ReactionMonitoringTransition::Product> actual_intermediate_products_;
128 
130 
132 
134 
136  void handleCVParam_(const String & parent_parent_tag, const String & parent_tag, const CVTerm & cv_term);
137 
139  void handleUserParam_(const String & parent_parent_tag, const String & parent_tag, const String & name, const String & type, const String & value);
140 
142  void writeUserParam_(std::ostream & os, const MetaInfoInterface & meta, UInt indent) const;
143 
144  void writeUserParams_(std::ostream & os, const std::vector<MetaInfoInterface> & meta, UInt indent) const;
145 
146  void writeCVParams_(std::ostream & os, const CVTermList & cv_terms, UInt indent) const;
147 
148  // subfunctions of write
149  void writeTarget_(std::ostream & os, const std::vector<IncludeExcludeTarget>::const_iterator & it) const;
150 
151  void writeProduct_(std::ostream & os, const std::vector<ReactionMonitoringTransition::Product>::const_iterator & prod_it) const;
152 
153  void writeConfiguration_(std::ostream & os, const std::vector<ReactionMonitoringTransition::Configuration>::const_iterator & cit) const;
154 
156  ControlledVocabulary::CVTerm getChildWithName_(const String & parent_accession, const String & name) const;
157 
159  //void writeSourceFile_(std::ostream& os, const String& id, const SourceFile& software);
160 
161 private:
162 
163  TraMLHandler();
164  TraMLHandler(const TraMLHandler & rhs);
165  TraMLHandler & operator=(const TraMLHandler & rhs);
166  };
167  } // namespace Internal
168 } // namespace OpenMS
169 
170 #endif // OPENMS_FORMAT_HANDLERS_TRAMLHANDLER_H
171 
TargetedExperiment::Prediction actual_prediction_
Definition: TraMLHandler.h:107
TargetedExperiment::Peptide actual_peptide_
Definition: TraMLHandler.h:115
Representation of a CV term.
Definition: ControlledVocabulary.h:60
A more convenient string class.
Definition: String.h:57
TargetedExperiment::Protein actual_protein_
Definition: TraMLHandler.h:111
String tag_
Definition: TraMLHandler.h:95
Representation of controlled vocabulary term list.
Definition: CVTermList.h:54
Software actual_software_
Definition: TraMLHandler.h:109
std::vector< ReactionMonitoringTransition::Configuration > ConfigurationListType
Definition: TraMLHandler.h:60
Definition: TargetedExperimentHelper.h:360
CVTermList actual_interpretation_
Definition: TraMLHandler.h:125
TargetedExperiment::RetentionTime actual_rt_
Definition: TraMLHandler.h:113
XML handler for TraMLFile.
Definition: TraMLHandler.h:54
Base class for XML handlers.
Definition: XMLHandler.h:99
Description of a file location, used to store the origin of (meta) data.
Definition: SourceFile.h:47
Definition: TargetedExperimentHelper.h:332
Description of the software used for processing.
Definition: Software.h:49
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
TargetedExperiment::Instrument actual_instrument_
Definition: TraMLHandler.h:105
Representation of a controlled vocabulary.
Definition: ControlledVocabulary.h:54
ReactionMonitoringTransition::Product actual_product_
Definition: TraMLHandler.h:129
Definition: TargetedExperimentHelper.h:55
Definition: TargetedExperimentHelper.h:447
TargetedExperiment::Compound actual_compound_
Definition: TraMLHandler.h:117
IncludeExcludeTarget actual_target_
Definition: TraMLHandler.h:121
Representation of controlled vocabulary term.
Definition: CVTerm.h:51
const ProgressLogger & logger_
Progress logger.
Definition: TraMLHandler.h:90
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition: MetaInfoInterface.h:56
TargetedExperiment::Contact actual_contact_
Definition: TraMLHandler.h:103
Definition: TargetedExperimentHelper.h:172
ControlledVocabulary cv_
Controlled vocabulary (psi-ms from OpenMS/share/OpenMS/CV/psi-ms.obo)
Definition: TraMLHandler.h:93
ReactionMonitoringTransition::Configuration actual_configuration_
Definition: TraMLHandler.h:131
This class stores a SRM/MRM transition.
Definition: IncludeExcludeTarget.h:53
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:55
This class stores an prediction of an SRM/MRM transition.
Definition: TargetedExperiment.h:53
Definition: TargetedExperimentHelper.h:388
Definition: TargetedExperimentHelper.h:133
Definition: TargetedExperimentHelper.h:416
ReactionMonitoringTransition actual_transition_
Definition: TraMLHandler.h:119
Definition: TargetedExperimentHelper.h:102
TargetedExperiment::Publication actual_publication_
Definition: TraMLHandler.h:101
TargetedExperiment * exp_
Definition: TraMLHandler.h:97
std::vector< ReactionMonitoringTransition::Product > ProductListType
Definition: TraMLHandler.h:59
std::vector< ReactionMonitoringTransition::Product > actual_intermediate_products_
Definition: TraMLHandler.h:127
Definition: TargetedExperimentHelper.h:211
SourceFile actual_sourcefile_
Definition: TraMLHandler.h:133
CVTermList actual_validation_
Definition: TraMLHandler.h:123
This class stores a SRM/MRM transition.
Definition: ReactionMonitoringTransition.h:55
const TargetedExperiment * cexp_
Definition: TraMLHandler.h:99

OpenMS / TOPP release 2.0.0 Documentation generated on Tue Nov 1 2016 16:34:46 using doxygen 1.8.11