Mass++ mzML IO Plugin v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations
MzmlHandler.cpp
Go to the documentation of this file.
1 
12 #include "stdafx.h"
13 #include "MzmlHandler.h"
14 
15 #include "MzmlSample.h"
16 #include "MzmlSpectrum.h"
17 #include "MzmlChromatogram.h"
18 
19 #include "AccessionManager.h"
20 #include "Accession.h"
21 
22 
23 using namespace kome::io::mzml;
24 
25 
26 #include <crtdbg.h>
27 #ifdef _DEBUG
28  #define new new( _NORMAL_BLOCK, __FILE__, __LINE__ )
29  #define malloc( s ) _malloc_dbg( s, _NORMAL_BLOCK, __FILE__, __LINE__ )
30 #endif // _DEBUG
31 
32 
33 
34 #define MACHINE_ACC "MS:1000031"
35 #define ARRAY_ACC "MS:1000513"
36 #define MZ_ARRAY_ACC "MS:1000514"
37 #define RT_ARRAY_ACC "MS:1000595"
38 #define INT_ARRAY_ACC "MS:1000515"
39 #define SPEC_TYPE_ACC "MS:1000559"
40 #define SOFTWARE_ACC "MS:1000531"
41 
42 #define CVPARAM_TAG_NAME "cvParam"
43 #define SRC_FILE_TAG_NAME "sourceFile"
44 #define SOFTWARE_TAG_NAME "software"
45 #define PARAM_GROUP_TAG_NAME "referenceableParamGroup"
46 #define SPEC_TAG_NAME "spectrum"
47 #define PRECURSOR_TAG_NAME "precursor"
48 #define PRODUCT_TAG_NAME "product"
49 #define CHROM_TAG_NAME "chromatogram"
50 #define ION_SELECTION_TAG_NAME "ionSelection"
51 #define USR_PARAM_TAG_NAME "userParam"
52 #define OFFSET_TAG_NAME "offset"
53 #define REF_TAG_NAME "referenceableParamGroupRef"
54 
55 
56 #define CV_ACC_ATTR_NAME "accession"
57 #define CV_NAME_ATTR_NAME "name"
58 #define CV_VALUE_ATTR_NAME "value"
59 #define CV_UNIT_ATTR_NAME "unitAccession"
60 #define SRC_FILE_ATTR_NAME "name"
61 #define SRC_LOC_ATTR_NAME "location"
62 #define SOFTWARE_ID_ATTR_NAME "id"
63 #define SOFTWARE_VER_ATTR_NAME "version"
64 #define PARAM_GROUP_ID_ATTR_NAME "id"
65 #define SPEC_ID_ATTR_NAME "id"
66 #define SPEC_SCAN_NUM_ATTR_NAME "scanNumber"
67 #define PREC_SPEC_ATTR_NAME "spectrumRef"
68 #define CHROM_ID_ATTR_NAME "id"
69 #define SPEC_MS_LEVEL_ATTR_NAME "msLevel"
70 #define USR_PARAM_NAME_ATTR_NAME "name"
71 #define USR_PARAM_VAL_ATTR_NAME "value"
72 #define OFFSET_SCAN_ATTR_NAME "scanNumber"
73 #define OFFSET_IDREF_ATTR_NAME "idRef"
74 #define REF_REF_ATTR_NAME "ref"
75 
76 
77 // constructor
78 MzmlHandler::MzmlHandler( MzmlSample& file ) : m_file( file ) {
79  // initialize
81 
82  // accessions
84 
85  m_machineAcc = accManager.getAccession( MACHINE_ACC );
86  m_arrAcc = accManager.getAccession( ARRAY_ACC );
87  m_specAcc = accManager.getAccession( SPEC_TYPE_ACC );
88  m_softwareAcc = accManager.getAccession( SOFTWARE_ACC );
89 }
90 
91 // destructor
93 }
94 
95 // get SpecInfo
97  // name
98  std::string n = trimstring( name );
99 
100  // spec info
101  bool iniFlg = ( m_specMap.find( n ) == m_specMap.end() );
102  SpecInfo* s = &( m_specMap[ n ] );
103 
104  // initialize
105  if( iniFlg ) {
106  s->stage = -1;
107  s->centroid = -1;
108  s->polarity = kome::objects::Spectrum::POLARITY_UNKNOWN;
109  s->mzLowerLimit = -1.0;
110  s->mzUpperLimit = -1.0;
111  s->tic = -1.0;
112  s->bpm = -1.0;
113  s->bpi = -1.0;
114  s->rt = -1.0;
115  s->prec = -1.0;
116  s->props.clear();
117  s->collisionEnergy.clear();
118  }
119 
120  return s;
121 }
122 
123 // set spec info
124 void MzmlHandler::setSpecInfo( kome::objects::Spectrum* spec, SpecInfo* info ) {
125  if( info->stage > 0 ) {
126  spec->setMsStage( info->stage );
127  }
128 
129  if( info->centroid == 0 || info->centroid == 1 ) {
130  spec->setCentroidMode( info->centroid == 1 );
131  }
132 
133  if( info->polarity != kome::objects::Spectrum::POLARITY_UNKNOWN ) {
134  spec->setPolarity( info->polarity );
135  }
136 
137  if( info->mzLowerLimit >= 0.0 ) {
138  spec->setMinX( info->mzLowerLimit );
139  }
140 
141  if( info->mzUpperLimit >= 0.0 ) {
142  spec->setMaxX( info->mzUpperLimit );
143  }
144 
145  if( info->tic >= 0.0 ) {
146  spec->setTotalIntensity( info->tic );
147  }
148 
149  if( info->bpi >= 0.0 ) {
150  spec->setMaxIntensity( info->bpi );
151  }
152 
153  if( info->prec >= 0.0 ) {
154  spec->setPrecursor( info->prec );
155  }
156 
157  if( !info->collisionEnergy.empty() ) {
158  spec->setCollisionEnergy( info->collisionEnergy.c_str() );
159  }
160 
161  for( unsigned int i = 0; i < info->props.size(); i++ ) {
162  spec->getProperties().setValue( info->props.at( i ).first.c_str(), info->props.at( i ).second.c_str() );
163  }
164 }
165 
166 // start document
168  // clear maps
169  m_specIdMap.clear();
170  m_specScanMap.clear();
171  m_chromIdMap.clear();
172 
173  // spectrum values
174  m_currSpec = NULL;
175  m_scanNum = 0;
176  m_currSpecInfo = getSpecInfo( NULL );
177 
178  // chromatogram values
179  m_currChrom = NULL;
180 
181  // offset
182  m_offsetScan = -1;
183 
184  // flag
185  m_inIonTag = false;
186  m_inPrecursor = false;
187  m_inProduct = false;
188 
189  // position
190  m_pos = -1;
191 }
192 
193 // end document
195 }
196 
197 // start element
198 void MzmlHandler::onStartElement( const char* name, kome::core::Properties& attrs ) {
199  // each tags
200  if( strcmp( name, CVPARAM_TAG_NAME ) == 0 ) { // <cvParam>
201  const char* a = attrs.getStringValue( CV_ACC_ATTR_NAME, "" );
202  const char* n = attrs.getStringValue( CV_NAME_ATTR_NAME, "" );
203  const char* v = attrs.getStringValue( CV_VALUE_ATTR_NAME, "" );
204 
205  if( strcmp( a, "MS:1000511" ) == 0 ) { // ms level
206  int stage = toint( v, 10, 1 );
207  if( m_currSpec == NULL ) {
208  m_currSpecInfo->stage = stage;
209  }
210  else {
211  m_currSpec->setMsStage( stage );
212  }
213  }
214  else if( strcmp( a, "MS:1000521" ) == 0 ) { // 32-bit float
215  m_arrayInfo.bits = 32;
216  }
217  else if( strcmp( a, "MS:1000523" ) == 0 ) { // 64-bit float
218  m_arrayInfo.bits = 64;
219  }
220  else if( strcmp( a, "MS:1000576" ) == 0 ) { // no compression
221  m_arrayInfo.compressed = false;
222  }
223  else if( strcmp( a, "MS:1000574" ) == 0 ) { // zlib compression
224  m_arrayInfo.compressed = true;
225  }
226  else if( strcmp( a, "MS:1000127" ) == 0 ) { // centroid spectrum
227  if( m_currSpec == NULL ) {
228  m_currSpecInfo->centroid = 1;
229  }
230  else {
231  m_currSpec->setCentroidMode( true );
232  }
233  }
234  else if( strcmp( a, "MS:1000128" ) == 0 ) { // profile spectrum
235  if( m_currSpec == NULL ) {
236  m_currSpecInfo->centroid = 0;
237  }
238  else {
239  m_currSpec->setCentroidMode( false );
240  }
241  }
242  else if( strcmp( a, "MS:1000129" ) == 0 ) { // negative scan
243  if( m_currSpec == NULL ) {
244  m_currSpecInfo->polarity = kome::objects::Spectrum::POLARITY_NEGATIVE;
245  }
246  else {
247  m_currSpec->setPolarity( kome::objects::Spectrum::POLARITY_NEGATIVE );
248  }
249  }
250  else if( strcmp( a, "MS:1000130" ) == 0 ) { // positive scan
251  if( m_currSpec == NULL ) {
252  m_currSpecInfo->polarity = kome::objects::Spectrum::POLARITY_POSITIVE;
253  }
254  else {
255  m_currSpec->setPolarity( kome::objects::Spectrum::POLARITY_POSITIVE );
256  }
257  }
258  else if( strcmp( a, "MS:1000501" ) == 0 ) { // scan m/z lower limit
259  double lowMz = todouble( v, -1.0 );
260  if( m_currSpec == NULL ) {
261  m_currSpecInfo->mzLowerLimit = lowMz;
262  }
263  else {
264  m_currSpec->setMinX( lowMz );
265  }
266  }
267  else if( strcmp( a, "MS:1000500" ) == 0 ) { // scan m/z upper limit
268  double upMz = todouble( v, -1.0 );
269  if( m_currSpec == NULL ) {
270  m_currSpecInfo->mzUpperLimit = upMz;
271  }
272  else {
273  m_currSpec->setMaxX( upMz );
274  }
275  }
276  else if( strcmp( a, "MS:1000285" ) == 0 ) { // total ion current
277  double tic = todouble( v, -1.0 );
278  if( m_currSpec == NULL ) {
279  m_currSpecInfo->tic = tic;
280  }
281  else {
282  m_currSpec->setTotalIntensity( tic );
283  }
284  }
285  else if( strcmp( a, "MS:1000504" ) == 0 ) { // base peak m/z
286  double bpm = todouble( v, -1.0 );
287  if( m_currSpec == NULL ) {
288  m_currSpecInfo->bpm = bpm;
289  }
290  else {
291  m_currSpec->setBasePeakMass( bpm );
292  }
293  }
294  else if( strcmp( a, "MS:1000505" ) == 0 ) { // base peak intensity
295  double bpi = todouble( v, -1.0 );
296  if( m_currSpec == NULL ) {
297  m_currSpecInfo->bpi = bpi;
298  }
299  else {
300  m_currSpec->setMaxIntensity( bpi );
301  }
302  }
303  else if( strcmp( a, "MS:1000016" ) == 0 ) { // scan start time
304  double rt = todouble( v, -1.0 );
305  const char* unit = attrs.getStringValue( CV_UNIT_ATTR_NAME, "" );
306  if( strcmp( unit, "UO:0000031" ) != 0 ) { // second
307  rt /= 60.0;
308  }
309 
310  if( m_currSpec == NULL ) {
311  m_currSpecInfo->rt = rt;
312  }
313  else {
314  m_currSpec->setRt( rt );
315  m_currSpec->setHasChromatogram( true );
316  }
317  }
318  else if( strcmp( a, "MS:1000744" ) == 0 ) { // selected ion m/z
319  double prec = todouble( v, -1.0 );
320  if( m_currSpec == NULL ) {
321  m_currSpecInfo->prec = prec;
322  }
323  else {
324  m_currSpec->setPrecursor( prec );
325  }
326  }
327  else if( strcmp( a, "MS:1000512" ) == 0 ) { // filter string
328  if( m_currSpec == NULL ) {
329  m_currSpecInfo->props.push_back( std::make_pair( "Filter", v ) );
330  }
331  else {
332  m_currSpec->getProperties().setValue( "Filter", v );
333  }
334  }
335  else if( strcmp( a, "MS:1000040" ) == 0 ) { // m/z
336  double mz = todouble( v, -1.0 );
337  if( m_inIonTag && m_currSpec != NULL ) {
338  m_currSpec->setPrecursor( mz );
339  }
340  }
341  else if( strcmp( a, "MS:1000827" ) == 0 ) { // isolation window target m/z
342  if( m_currSpec != NULL || m_currSpecInfo != NULL ) { // spectrum
343  std::string name = "Isolation Window Target m/z";
344  if( m_inPrecursor ) {
345  name = "Precursor Target";
346  }
347  if( m_inProduct ) {
348  name = "Product Target";
349  }
350 
351  if( m_currSpec == NULL ) {
352  m_currSpecInfo->props.push_back( std::make_pair( name.c_str(), v ) );
353  }
354  else {
355  m_currSpec->getProperties().setValue( name.c_str(), v );
356  }
357  }
358 
359  if( m_currChrom != NULL ) { // chromatogram
360  double mz = todouble( v, -1.0 );
361  if( mz >= 0.0 ) {
362  if( m_inPrecursor ) {
363  m_currChrom->setQ1( mz );
364  }
365  else if( m_inProduct ) {
366  m_currChrom->setQ3( mz );
367  }
368  }
369  }
370  }
371  else if( strcmp( a, "MS:1000045" ) == 0 ) {
372  const char* unitId = attrs.getStringValue( "unitAccession", "" );
373  std::string ce = v;
374  if( strcmp( unitId, "UO:0000266" ) == 0 ) {
375  ce = FMT( "%s eV", v );
376  }
377  if( m_currSpec == NULL ) {
378  m_currSpecInfo->collisionEnergy = ce;
379  }
380  else {
381  m_currSpec->setCollisionEnergy( ce.c_str() );
382  }
383  }
384  else {
385  // accession
387  Accession* acc = accManager.getAccession( a );
388 
389  // parent
390  Accession* parent = ( acc == NULL ? NULL : acc->getOrigin() );
391 
392  // each accessions
393  if( parent == m_machineAcc ) { // machine name
394  m_file.setInstrument( n );
395  }
396  else if( parent == m_arrAcc ) { // array type
397  // unit scale size
398  const char* u = attrs.getStringValue( CV_UNIT_ATTR_NAME, "" );
399  m_arrayInfo.isY = false;
400 
401  // set type
402  if( strcmp( a, MZ_ARRAY_ACC ) == 0 ) {
403  m_currType = TYPE_MZ;
404  }
405  else if( strcmp( a, RT_ARRAY_ACC ) == 0 ) {
406  m_currType = TYPE_RT;
407  if( strcmp( u, "UO:0000031" ) != 0 ) { // second
408  m_arrayInfo.scale = 1.0 / 60.0;
409  }
410  }
411  else if( strcmp( a, INT_ARRAY_ACC ) == 0 ) {
412  m_currType = TYPE_INT;
413  m_arrayInfo.isY = true;
414  }
415  else {
416  m_currType = TYPE_OTHER;
417  }
418  }
419  else if( parent == m_specAcc ) { // spectrum type
420  if( m_currSpec == NULL ) {
421  m_currSpecInfo->props.push_back( std::make_pair( "Spectrum Type", n ) );
422  }
423  else {
424  m_currSpec->getProperties().setValue( "Spectrum Type", n );
425  }
426  }
427  else if( parent == m_softwareAcc ) { // software
428  m_currSoftwareName = acc->getName();
429  }
430  }
431  }
432  else if( strcmp( name, SRC_FILE_TAG_NAME ) == 0 ) { // <sourceFile>
433  // add source file
434  std::string file = attrs.getStringValue( SRC_FILE_ATTR_NAME, "" );
435  std::string location = attrs.getStringValue( SRC_LOC_ATTR_NAME, "" );
436 
437  if( !location.empty() ) {
438  if( location[ (int)location.length() - 1 ] != '/' ) {
439  location.append( "/" );
440  }
441  }
442  location.append( file );
443 
444  m_file.addParentFile( location.c_str() );
445  }
446  else if( strcmp( name, SOFTWARE_TAG_NAME ) == 0 ) { // <software>
447  m_currSoftwareName = attrs.getStringValue( SOFTWARE_ID_ATTR_NAME, "" );
448  m_currSoftwareVersion = attrs.getStringValue( SOFTWARE_VER_ATTR_NAME, "" );
449  }
450  else if( strcmp( name, PARAM_GROUP_TAG_NAME ) == 0 ) { // <referenceableParamGroup>
451  m_arrayInfo.name = attrs.getStringValue( PARAM_GROUP_ID_ATTR_NAME, "" );
452  m_arrayInfo.bits = 32;
453  m_arrayInfo.compressed = false;
454  m_arrayInfo.scale = 1.0;
455  m_arrayInfo.isY = false;
456 
457  m_currType = TYPE_OTHER;
458 
459  m_currSpecInfo = getSpecInfo( m_arrayInfo.name.c_str() );
460  }
461  else if( strcmp( name, SPEC_TAG_NAME ) == 0 ) { // <spectrum>
462  // spectrum
463  const char* id = attrs.getStringValue( SPEC_ID_ATTR_NAME, "Scan" );
464  m_currSpec = new MzmlSpectrum( &m_file, id );
465  m_specIdMap[ id ] = m_currSpec;
466  long long pos = m_pos;
467  if( pos > 0 ) {
468  m_currSpec->setOffset( pos );
469  }
470 
471  m_file.getRootDataGroupNode()->addSpectrum( m_currSpec );
472 
473  // default attributes
474  SpecInfo* dfSpec = getSpecInfo( NULL );
475  setSpecInfo( m_currSpec, dfSpec );
476 
477  // set attributes
478  int scanNum = attrs.getIntValue( SPEC_SCAN_NUM_ATTR_NAME, m_scanNum );
479  m_scanNum++;
480  m_currSpec->setScanNumber( scanNum );
481  m_specScanMap[ scanNum ] = m_currSpec;
482 
483  int stage = attrs.getIntValue( SPEC_MS_LEVEL_ATTR_NAME, dfSpec->stage );
484  if( stage >= 1 ) {
485  m_currSpec->setMsStage( stage );
486  }
487 
488  std::string strSpotID = attrs.getStringValue( "spotID", "" );
489  if ( !strSpotID.empty( ) )
490  {
491  m_currSpec->setSpotId( strSpotID.c_str( ) );
492  }
493  }
494  else if( strcmp( name, PRECURSOR_TAG_NAME ) == 0 ) { // <precursor>
495  // parent
496  const char* id = attrs.getStringValue( PREC_SPEC_ATTR_NAME, NULL );
497  kome::objects::Spectrum* parent = NULL;
498 
499  if( id != NULL && m_currSpec != NULL ) {
500  if( m_specIdMap.find( id ) != m_specIdMap.end() ) {
501  parent = m_specIdMap[ id ];
502  }
503 
504  m_currSpec->setParentSpectrum( parent );
505  }
506 
507  m_inPrecursor = true;
508  }
509  else if( strcmp( name, PRODUCT_TAG_NAME ) == 0 ) { // <product>
510  m_inProduct = true;
511  }
512  else if( strcmp( name, CHROM_TAG_NAME ) == 0 ) { // <chromatogram>
513  // chromatogram
514  const char* id = attrs.getStringValue( CHROM_ID_ATTR_NAME, "Chromatogram" );
516  m_currChrom->setName( id );
517  m_chromIdMap[ id ] = m_currChrom;
518 
519  m_file.getRootDataGroupNode()->addChromatogram( m_currChrom );
520  }
521  else if( strcmp( name, ION_SELECTION_TAG_NAME ) == 0 ) { // <ionSelection>
522  m_inIonTag = true;
523  }
524  else if( strcmp( name, USR_PARAM_TAG_NAME ) == 0 ) { // <userParam>
525  // name & value
526  std::string n = attrs.getStringValue( USR_PARAM_NAME_ATTR_NAME, "" );
527  std::string v = attrs.getStringValue( USR_PARAM_VAL_ATTR_NAME, "" );
528 
529  // SPEC No.86058 File Name is "Err!" @@date 2012.06.11 <Mod> M.Izumi ->
530  // properties
531  kome::core::Properties* props = &m_file.getRootDataGroupNode()->getProperties();
532  if( m_currSpec != NULL ) {
533  props = &m_currSpec->getProperties();
534  }
535  if( m_currChrom != NULL ) {
536  props = &m_currChrom->getProperties();
537  }
538 
539  // add
540  if( !n.empty() ) {
541  props->setValue( n.c_str(), v.c_str() );
542  }
543  // <- @date 2012.06.11 <Mod> M.Izum
544  }
545  else if( strcmp( name, OFFSET_TAG_NAME ) == 0 ) { // <offset>
546  m_offsetScan = attrs.getIntValue( OFFSET_SCAN_ATTR_NAME, -1 );
547  m_offsetId = attrs.getStringValue( OFFSET_IDREF_ATTR_NAME, "" );
548  }
549  else if( strcmp( name, REF_TAG_NAME ) == 0 ) { // <referenceableParamGroupRef>
550  std::string id = attrs.getStringValue( REF_REF_ATTR_NAME, "" );
551 
552  if( m_currSpec != NULL ) {
553  SpecInfo* info = getSpecInfo( id.c_str() );
554 
555  setSpecInfo( m_currSpec, info );
556  }
557  }
558 }
559 
560 // end element
561 void MzmlHandler::onEndElement( const char* name, const char* text ) {
562  // each tags
563  if( strcmp( name, SOFTWARE_TAG_NAME ) == 0 ) { // </software>
564  if( strlen( m_file.getSoftwareName() ) == 0 ) {
565  m_file.setSoftwareName( m_currSoftwareName.c_str() );
566  m_file.setSoftwareVersion( m_currSoftwareVersion.c_str() );
567  }
568  m_currSoftwareName.clear();
569  m_currSoftwareVersion.clear();
570  }
571  else if( strcmp( name, SPEC_TAG_NAME ) == 0 ) { // </spectrum>
572  m_currSpec = NULL;
573  }
574  else if( strcmp( name, CHROM_TAG_NAME ) == 0 ) { // </chromatogram>
575  if( m_currChrom != NULL ) {
576  double q1 = m_currChrom->getQ1();
577  double q3 = m_currChrom->getQ3();
578 
579  if( q1 >= 0.0 && q3 >= 0.0 ) {
580  m_currChrom->setIcon( "MRM_chrom" );
581  }
582  }
583  m_currChrom = NULL;
584  }
585  else if( strcmp( name, PARAM_GROUP_TAG_NAME ) == 0 ) { // </referenceableParamGroup>
586  if( m_currType != TYPE_OTHER ) {
588  m_arrayInfo.name.c_str(),
589  m_arrayInfo.bits,
590  m_arrayInfo.compressed,
591  m_arrayInfo.scale, m_arrayInfo.isY
592  );
593  }
594 
595  m_currSpecInfo = getSpecInfo( NULL );
596  }
597  else if( strcmp( name, ION_SELECTION_TAG_NAME ) == 0 ) { // </ionSelection>
598  m_inIonTag = false;
599  }
600  else if( strcmp( name, PRECURSOR_TAG_NAME ) == 0 ) { // </precursor>
601  m_inPrecursor = false;
602  }
603  else if( strcmp( name, PRODUCT_TAG_NAME ) == 0 ) { // </product>
604  m_inProduct = false;
605  }
606  else if( strcmp( name, OFFSET_TAG_NAME ) == 0 ) { // </offset>
607  // offset
608  long long offset = toint64( text, 10, -1 );
609 
610  // get object
611  MzmlSpectrum* spec = NULL;
612  MzmlChromatogram* chrom = NULL;
613 
614  if( m_offsetScan >= 0 && m_specScanMap.find( m_offsetScan ) != m_specScanMap.end() ) {
615  spec = m_specScanMap[ m_offsetScan ];
616  }
617  if( m_specIdMap.find( m_offsetId ) != m_specIdMap.end() ) {
618  spec = m_specIdMap[ m_offsetId ];
619  }
620  if( m_chromIdMap.find( m_offsetId ) != m_chromIdMap.end() ) {
621  chrom = m_chromIdMap[ m_offsetId ];
622  }
623 
624  // set offset
625  if( spec != NULL ) {
626  spec->setOffset( offset );
627  }
628  if( chrom != NULL ) {
629  chrom->setOffset( offset );
630  }
631 
632  // initialize offset values
633  m_offsetScan = -1;
634  m_offsetId.clear();
635  }
636 
637  // position
638  m_pos = getPosition();
639 }
std::map< int, MzmlSpectrum * > m_specScanMap
Definition: MzmlHandler.h:143
static AccessionManager & getInstance()
gets accession manager object (This is the only object.)
MzmlChromatogram * m_currChrom
Definition: MzmlHandler.h:84
SpecInfo * getSpecInfo(const char *name)
gets the spectrum information
Definition: MzmlHandler.cpp:96
interfaces of MzmlSample class
const char * getName()
gets accession name
Definition: Accession.cpp:57
Accession * getOrigin()
gets origin accesion
Definition: Accession.cpp:72
void setOffset(const long long offset)
sets data offset
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
common header file
interfaces of Accession class
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)
Accession * getAccession(const unsigned int idx)
gets accession
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
accession object management class
std::string m_currSoftwareVersion
Definition: MzmlHandler.h:126
mzml sample spectrum class
accession information class
Definition: Accession.h:24
interfaces of MzmlHandler class
interfaces of MzmlChromatogram class
mzml sample spectrum class
Definition: MzmlSpectrum.h:29
void setSpecInfo(kome::objects::Spectrum *spec, SpecInfo *info)
sets the spectrum information
MzmlHandler(MzmlSample &file)
constructor
Definition: MzmlHandler.cpp:78
interfaces of MzmlSpectrum class
void setOffset(const long long offset)
sets data offset
void addArrayInfo(const char *name, const int bits, const bool compressed, const double scale, const bool isY)
adds array information
Definition: MzmlSample.cpp:83
virtual ~MzmlHandler()
destructor
Definition: MzmlHandler.cpp:92
mzML sample class
Definition: MzmlSample.h:26
MzmlSpectrum * m_currSpec
Definition: MzmlHandler.h:81
void addParentFile(const char *path)
adds parent files
Definition: MzmlSample.cpp:43