Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
MzIdentMLHandler.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-2013.
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, Andreas Bertsch $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_FORMAT_HANDLERS_MZIDENTMLHANDLER_H
36 #define OPENMS_FORMAT_HANDLERS_MZIDENTMLHANDLER_H
37 
39 
49 
50 #include <vector>
51 
52 namespace OpenMS
53 {
54  class ProgressLogger;
55 
56  namespace Internal
57  {
58 
64  class OPENMS_DLLAPI MzIdentMLHandler :
65  public XMLHandler
66  {
67 public:
70  MzIdentMLHandler(const Identification & id, const String & filename, const String & version, const ProgressLogger & logger);
73  MzIdentMLHandler(const std::vector<ProteinIdentification> & pro_id, const std::vector<PeptideIdentification> & pep_id, const String & filename, const String & version, const ProgressLogger & logger);
74 
76  MzIdentMLHandler(Identification & id, const String & filename, const String & version, const ProgressLogger & logger);
78  MzIdentMLHandler(std::vector<ProteinIdentification> & pro_id, std::vector<PeptideIdentification> & pep_id, const String & filename, const String & version, const ProgressLogger & logger);
79 
81  virtual ~MzIdentMLHandler();
83 
84 
85  // Docu in base class
86  virtual void endElement(const XMLCh * const /*uri*/, const XMLCh * const /*local_name*/, const XMLCh * const qname);
87 
88  // Docu in base class
89  virtual void startElement(const XMLCh * const /*uri*/, const XMLCh * const /*local_name*/, const XMLCh * const qname, const xercesc::Attributes & attributes);
90 
91  // Docu in base class
92  virtual void characters(const XMLCh * const chars, const XMLSize_t length);
93 
94  //Docu in base class
95  virtual void writeTo(std::ostream & os);
96 
97 protected:
98 
101 
106 
107  //~ MSExperiment<>* ms_exp_;
108 
111 
115  std::vector<ProteinIdentification> * pro_id_;
117  std::vector<PeptideIdentification> * pep_id_;
118 
120  const std::vector<ProteinIdentification> * cpro_id_;
121  const std::vector<PeptideIdentification> * cpep_id_;
122 
125 
128 
130  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="" */);
131 
133  void handleUserParam_(const String & parent_parent_tag, const String & parent_tag, const String & name, const String & type, const String & value);
134 
136  void writeUserParam_(std::ostream & os, const MetaInfoInterface & meta, UInt indent) const;
137 
139  ControlledVocabulary::CVTerm getChildWithName_(const String & parent_accession, const String & name) const;
140 
142  //void writeSourceFile_(std::ostream& os, const String& id, const SourceFile& software);
143 
144 
145 private:
147  MzIdentMLHandler(const MzIdentMLHandler & rhs);
148  MzIdentMLHandler & operator=(const MzIdentMLHandler & rhs);
153 
154  };
155  } // namespace Internal
156 } // namespace OpenMS
157 
158 #endif
SpectrumIdentification current_spectrum_id_
SpectrumIdentification Item.
Definition: MzIdentMLHandler.h:124
std::vector< PeptideIdentification > * pep_id_
Identification Item for peptides.
Definition: MzIdentMLHandler.h:117
Representation of a CV term.
Definition: ControlledVocabulary.h:60
A more convenient string class.
Definition: String.h:56
Map< String, AASequence > pep_sequences_
Definition: MzIdentMLHandler.h:149
IdentificationHit current_id_hit_
IdentificationHit Item.
Definition: MzIdentMLHandler.h:127
Int current_mod_location_
Definition: MzIdentMLHandler.h:151
AASequence actual_peptide_
Definition: MzIdentMLHandler.h:150
Base class for XML handlers.
Definition: XMLHandler.h:89
const ProgressLogger & logger_
Progress logger.
Definition: MzIdentMLHandler.h:100
Representation of a peptide/protein sequence.
Definition: AASequence.h:84
String tag_
XML tag parse element.
Definition: MzIdentMLHandler.h:110
const std::vector< ProteinIdentification > * cpro_id_
Definition: MzIdentMLHandler.h:120
Representation of a controlled vocabulary.
Definition: ControlledVocabulary.h:54
ControlledVocabulary cv_
Controlled vocabulary (psi-ms from OpenMS/share/OpenMS/CV/psi-ms.obo)
Definition: MzIdentMLHandler.h:103
XML handler for MzIdentMLFile.
Definition: MzIdentMLHandler.h:64
Represents a object which can store the information of an analysisXML instance.
Definition: SpectrumIdentification.h:50
Represents a object which can store the information of an analysisXML instance.
Definition: Identification.h:53
ProteinHit actual_protein_
Definition: MzIdentMLHandler.h:152
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition: MetaInfoInterface.h:61
Identification * id_
Identification Item.
Definition: MzIdentMLHandler.h:113
ControlledVocabulary unimod_
Controlled vocabulary for modifications (unimod from OpenMS/share/OpenMS/CV/unimod.obo)
Definition: MzIdentMLHandler.h:105
Representation of a protein hit.
Definition: ProteinHit.h:54
std::vector< ProteinIdentification > * pro_id_
internal Identification Item for proteins
Definition: MzIdentMLHandler.h:115
Represents a object which can store the information of an analysisXML instance.
Definition: IdentificationHit.h:49
const std::vector< PeptideIdentification > * cpep_id_
Definition: MzIdentMLHandler.h:121
Base class for all classes that want to report their progess.
Definition: ProgressLogger.h:56
const Identification * cid_
Definition: MzIdentMLHandler.h:119
int Int
Signed integer type.
Definition: Types.h:100
Map class based on the STL map (containing serveral convenience functions)
Definition: Map.h:50

OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:18 using doxygen 1.8.5