Mass++ mzML IO Plugin v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations
MzmlHandler.h
Go to the documentation of this file.
1 
12 #ifndef __KOME_IO_MZML_HANDLER_H__
13 #define __KOME_IO_MZML_HANDLER_H__
14 
15 
16 #include "MzmlSample.h"
17 
18 #include <map>
19 
20 
21 namespace kome {
22  namespace io {
23  namespace mzml {
24 
25  class Accession;
26  class MzmlSpectrum;
27  class MzmlChromatogram;
28 
33  class MzmlHandler : public kome::xml::XmlHandler {
34  public:
40  MzmlHandler( MzmlSample& file );
41 
46  virtual ~MzmlHandler();
47 
48  protected:
51 
52  protected:
55 
58 
61 
64 
66  long long m_pos;
67 
68  protected:
73  typedef enum {
74  TYPE_OTHER,
75  TYPE_MZ,
76  TYPE_RT,
77  TYPE_INT
78  } ArrayType;
79 
82 
85 
88 
91 
92  protected:
94  int m_scanNum;
95 
100  struct SpecInfo {
101  int stage;
102  int centroid;
103  kome::objects::Spectrum::Polarity polarity;
104  double mzLowerLimit;
105  double mzUpperLimit;
106  double tic;
107  double bpm;
108  double bpi;
109  double rt;
110  double prec;
111  std::string collisionEnergy;
112  std::vector< std::pair< std::string, std::string > > props;
113  };
114 
116  std::map< std::string, SpecInfo > m_specMap;
117 
120 
121  protected:
123  std::string m_currSoftwareName;
124 
127 
128  protected:
131 
134 
137 
138  protected:
140  std::map< std::string, MzmlSpectrum* > m_specIdMap;
141 
143  std::map< int, MzmlSpectrum* > m_specScanMap;
144 
146  std::map< std::string, MzmlChromatogram* > m_chromIdMap;
147 
150 
152  std::string m_offsetId;
153 
154  protected:
161  SpecInfo* getSpecInfo( const char* name );
162 
169  void setSpecInfo( kome::objects::Spectrum* spec, SpecInfo* info );
170 
171  protected:
176  virtual void onStartDocument();
177 
182  virtual void onEndDocument();
183 
190  virtual void onStartElement( const char* name, kome::core::Properties& attrs );
191 
198  virtual void onEndElement( const char* name, const char* text );
199  };
200  }
201  }
202 }
203 
204 
205 #endif // __KOME_IO_MZML_HANDLER_H__
std::map< int, MzmlSpectrum * > m_specScanMap
Definition: MzmlHandler.h:143
XML handler class to read mzML file.
Definition: MzmlHandler.h:33
MzmlChromatogram * m_currChrom
Definition: MzmlHandler.h:84
SpecInfo * getSpecInfo(const char *name)
gets the spectrum information
Definition: MzmlHandler.cpp:96
interfaces of MzmlSample class
std::map< std::string, SpecInfo > m_specMap
Definition: MzmlHandler.h:116
MzmlSample::ArrayInfo m_arrayInfo
Definition: MzmlHandler.h:90
virtual void onEndDocument()
This method is called by endDocument method. (override method)
std::map< std::string, MzmlChromatogram * > m_chromIdMap
Definition: MzmlHandler.h:146
virtual void onEndElement(const char *name, const char *text)
This method is called by end element method. (override method)
virtual void onStartDocument()
This method is called by startDocument method. (override method)
virtual void onStartElement(const char *name, kome::core::Properties &attrs)
This method is called by startElement method. (override method)
std::map< std::string, MzmlSpectrum * > m_specIdMap
Definition: MzmlHandler.h:140
std::string m_currSoftwareVersion
Definition: MzmlHandler.h:126
mzml sample spectrum class
accession information class
Definition: Accession.h:24
mzml sample spectrum class
Definition: MzmlSpectrum.h:29
void setSpecInfo(kome::objects::Spectrum *spec, SpecInfo *info)
sets the spectrum information
ArrayType
array data type
Definition: MzmlHandler.h:73
MzmlHandler(MzmlSample &file)
constructor
Definition: MzmlHandler.cpp:78
virtual ~MzmlHandler()
destructor
Definition: MzmlHandler.cpp:92
mzML sample class
Definition: MzmlSample.h:26
MzmlSpectrum * m_currSpec
Definition: MzmlHandler.h:81