Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

MzDataHandler Class Template Reference

#include <OpenMS/FORMAT/HANDLERS/MzDataHandler.h>

Inheritance diagram for MzDataHandler:

XMLHandler xercesc::DefaultHandler

List of all members.


Detailed Description

template<typename MapType>
class OpenMS::Internal::MzDataHandler< MapType >

XML handler for MzDataFile.

MapType has to be a MSExperiment or have the same interface. Do not use this class. It is only needed in MzDataFile.

Public Member Functions

virtual void endElement (const XMLCh *const , const XMLCh *const , const XMLCh *const qname)
 Parsing method for closing tags.
virtual void startElement (const XMLCh *const , const XMLCh *const , const XMLCh *const qname, const xercesc::Attributes &attributes)
 Parsing method for opening tags.
virtual void characters (const XMLCh *const chars, const unsigned int length)
 Parsing method for character data.
void writeTo (std::ostream &os)
 Writes the contents to a stream.
void setOptions (const PeakFileOptions &opt)
template<>
void writeDerivedPeakSupplementalData_ (std::ostream &os, DPeakArray< PickedPeak1D > const &container)
template<>
void readPeakSupplementalData_ (PickedPeak1D &peak, UInt n)
Constructors and destructor
 MzDataHandler (MapType &exp, const String &filename, const String &version, ProgressLogger &logger)
 Constructor for a write-only handler.
 MzDataHandler (const MapType &exp, const String &filename, const String &version, const ProgressLogger &logger)
 Constructor for a read-only handler.
virtual ~MzDataHandler ()
 Destructor.

Protected Types

typedef MapType::PeakType PeakType
 Peak type.
typedef MSSpectrum< PeakType,
std::allocator< PeakType > > 
SpectrumType
 Spectrum type.

Protected Member Functions

void fillData_ ()
 fills the experiment with peaks
void cvParam_ (const String &name, const String &value)
 read attributes of MzData's cvParamType
void writeBinary_ (std::ostream &os, UInt size, const String &tag, const String &desc="", int id=-1)
 write binary data to stream (first one)
template<typename ContainerType>
void writeDerivedPeakSupplementalData_ (std::ostream &, ContainerType const &)
 Write supplemental data for derived classes of DPeak, e.g. for picked peaks. Default is to do nothing.
template<typename PeakType>
void readPeakSupplementalData_ (PeakType &, UInt)
 Read supplemental data for derived classes of DPeak, e.g. for picked peaks. Default is to do nothing.
double getDecodedValue_ (UInt lindex, UInt vindex)
 Returns value with the index vindex of the decoded array with the index lindex.

Protected Attributes

MapType * exp_
 map pointer for reading
const MapType * cexp_
 map pointer for writing
PeakFileOptions options_
 Options that can be set for loading/storing.
Base64 decoder_
 Decoder/Encoder for Base64-data in MzData.
UInt spec_write_counter_
 spectrum counter (needed because spectra without peaks are not written)
bool in_description_
 Flag that indicates that of the parser is in a description.
bool skip_spectrum_
 Flag that indicates wether this spectrum should be skipped (due to options).
const ProgressLoggerlogger_
 Progress logger.
temporary datastructures to hold parsed data
UInt peak_count_
SpectrumType spec_
String meta_id_
std::vector< Stringdata_to_decode_
 encoded data which is read and has to be decoded
std::vector< Realdata_to_encode_
 floating point numbers which have to be encoded and written
std::vector< std::vector< Real > > decoded_list_
std::vector< std::vector
< DoubleReal > > 
decoded_double_list_
std::vector< Stringarray_name_
std::vector< Stringprecisions_
std::vector< Stringendians_
std::stringstream exp_sett_
 stream to collect experimental settings

Private Member Functions

 MzDataHandler ()
 Not impelmented.


Member Typedef Documentation

typedef MapType::PeakType PeakType [protected]

Peak type.

typedef MSSpectrum<PeakType, std::allocator<PeakType> > SpectrumType [protected]

Spectrum type.


Constructor & Destructor Documentation

MzDataHandler ( MapType &  exp,
const String filename,
const String version,
ProgressLogger logger 
) [inline]

Constructor for a write-only handler.

MzDataHandler ( const MapType &  exp,
const String filename,
const String version,
const ProgressLogger logger 
) [inline]

Constructor for a read-only handler.

virtual ~MzDataHandler (  )  [inline, virtual]

Destructor.

MzDataHandler (  )  [private]

Not impelmented.


Member Function Documentation

void endElement ( const XMLCh *  uri,
const XMLCh *  localname,
const XMLCh *const   qname 
) [inline, virtual]

Parsing method for closing tags.

Reimplemented from XMLHandler.

void startElement ( const XMLCh *  uri,
const XMLCh *  localname,
const XMLCh *const   qname,
const xercesc::Attributes &  attrs 
) [inline, virtual]

Parsing method for opening tags.

Reimplemented from XMLHandler.

void characters ( const XMLCh *const   chars,
const unsigned int  length 
) [inline, virtual]

Parsing method for character data.

Reimplemented from XMLHandler.

void writeTo ( std::ostream &  os  )  [inline, virtual]

Writes the contents to a stream.

Reimplemented from XMLHandler.

void setOptions ( const PeakFileOptions opt  )  [inline]

void fillData_ (  )  [inline, protected]

fills the experiment with peaks

void cvParam_ ( const String name,
const String value 
) [inline, protected]

read attributes of MzData's cvParamType

Example: <cvParam cvLabel="psi" accession="PSI:1000001" name="name" value="value"/> name and sometimes value are defined in the MzData ontology.

void writeBinary_ ( std::ostream &  os,
UInt  size,
const String tag,
const String desc = "",
int  id = -1 
) [inline, protected]

write binary data to stream (first one)

void writeDerivedPeakSupplementalData_ ( std::ostream &  ,
ContainerType const &   
) [inline, protected]

Write supplemental data for derived classes of DPeak, e.g. for picked peaks. Default is to do nothing.

void readPeakSupplementalData_ ( PeakType ,
UInt   
) [inline, protected]

Read supplemental data for derived classes of DPeak, e.g. for picked peaks. Default is to do nothing.

double getDecodedValue_ ( UInt  lindex,
UInt  vindex 
) [inline, protected]

Returns value with the index vindex of the decoded array with the index lindex.

void writeDerivedPeakSupplementalData_< DPeakArray< PickedPeak1D > > ( std::ostream &  os,
DPeakArray< PickedPeak1D > const &  container 
) [inline]

Note:
Partial specialization must be placed in .C file

void readPeakSupplementalData_< PickedPeak1D > ( PickedPeak1D peak,
UInt  n 
) [inline]

Note:
Partial specialization must be placed in .C file


Member Data Documentation

MapType* exp_ [protected]

map pointer for reading

const MapType* cexp_ [protected]

map pointer for writing

PeakFileOptions options_ [protected]

Options that can be set for loading/storing.

UInt peak_count_ [protected]

SpectrumType spec_ [protected]

String meta_id_ [protected]

std::vector<String> data_to_decode_ [protected]

encoded data which is read and has to be decoded

std::vector<Real> data_to_encode_ [protected]

floating point numbers which have to be encoded and written

std::vector<std::vector<Real> > decoded_list_ [protected]

std::vector<std::vector<DoubleReal> > decoded_double_list_ [protected]

std::vector<String> array_name_ [protected]

std::vector<String> precisions_ [protected]

std::vector<String> endians_ [protected]

std::stringstream exp_sett_ [protected]

stream to collect experimental settings

Base64 decoder_ [protected]

Decoder/Encoder for Base64-data in MzData.

UInt spec_write_counter_ [protected]

spectrum counter (needed because spectra without peaks are not written)

bool in_description_ [protected]

Flag that indicates that of the parser is in a description.

bool skip_spectrum_ [protected]

Flag that indicates wether this spectrum should be skipped (due to options).

const ProgressLogger& logger_ [protected]

Progress logger.


The documentation for this class was generated from the following file:
Generated Tue Apr 1 15:36:49 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1