Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
MzMLSpectrumDecoder Class Reference

A class to decode input strings that contain an mzML chromatogram or spectrum tag. More...

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

Public Member Functions

 MzMLSpectrumDecoder ()
 
void domParseSpectrum (const std::string &in, OpenMS::Interfaces::SpectrumPtr &sptr)
 Extract data from a string which contains a full mzML spectrum. More...
 
void domParseChromatogram (const std::string &in, OpenMS::Interfaces::ChromatogramPtr &cptr)
 Extract data from a string which contains a full mzML chromatogram. More...
 
void setSkipXMLChecks (bool only)
 Whether to skip some XML checks (e.g. removing whitespace inside base64 arrays) and be fast instead. More...
 

Protected Types

typedef Internal::MzMLHandlerHelper::BinaryData BinaryData
 

Protected Member Functions

OpenMS::Interfaces::SpectrumPtr decodeBinaryDataSpectrum_ (std::vector< BinaryData > &data_)
 decode binary data More...
 
OpenMS::Interfaces::ChromatogramPtr decodeBinaryDataChrom_ (std::vector< BinaryData > &data_)
 decode binary data More...
 
void handleBinaryDataArray_ (xercesc::DOMNode *indexListNode, std::vector< BinaryData > &data_)
 Convert a single DOMNode of type binaryDataArray to BinaryData object. More...
 
void domParseString_ (const std::string &in, std::vector< BinaryData > &data_)
 Extract data from a string containing multiple <binaryDataArray> tags. More...
 

Protected Attributes

bool skip_xml_checks_
 

Detailed Description

A class to decode input strings that contain an mzML chromatogram or spectrum tag.

It uses xercesc to parse a string containing either a exactly one mzML spectrum or chromatogram (from <chromatogram> to </chromatogram> or <spectrum> to </spectrum> tag). It returns the data contained in the binaryDataArray for Intensity / mass-to-charge or Intensity / time.

Member Typedef Documentation

◆ BinaryData

Constructor & Destructor Documentation

◆ MzMLSpectrumDecoder()

MzMLSpectrumDecoder ( )
inline

Member Function Documentation

◆ decodeBinaryDataChrom_()

OpenMS::Interfaces::ChromatogramPtr decodeBinaryDataChrom_ ( std::vector< BinaryData > &  data_)
protected

decode binary data

Duplicated code from MzMLHandler, need to clean up see void MzMLHandler<MapType>::fillData_()

◆ decodeBinaryDataSpectrum_()

OpenMS::Interfaces::SpectrumPtr decodeBinaryDataSpectrum_ ( std::vector< BinaryData > &  data_)
protected

decode binary data

Duplicated code from MzMLHandler, need to clean up see void MzMLHandler<MapType>::fillData_()

◆ domParseChromatogram()

void domParseChromatogram ( const std::string &  in,
OpenMS::Interfaces::ChromatogramPtr cptr 
)

Extract data from a string which contains a full mzML chromatogram.

Extracts data from the input string which is expected to contain exactly one <chromatogram> tag (from <chromatogram> to </chromatogram>). This function will extract the contained binaryDataArray and provide the result as Chromatogram.

Parameters
inInput string containing the raw XML
cptrResulting chromatogram
Precondition
in must have <chromatogram> as root element.

◆ domParseSpectrum()

void domParseSpectrum ( const std::string &  in,
OpenMS::Interfaces::SpectrumPtr sptr 
)

Extract data from a string which contains a full mzML spectrum.

Extracts data from the input string which is expected to contain exactly one <spectrum> tag (from <spectrum> to </spectrum>). This function will extract the contained binaryDataArray and provide the result as Spectrum.

Parameters
inInput string containing the raw XML
sptrResulting spectrum
Precondition
in must have <spectrum> as root element.

◆ domParseString_()

void domParseString_ ( const std::string &  in,
std::vector< BinaryData > &  data_ 
)
protected

Extract data from a string containing multiple <binaryDataArray> tags.

This may be a string from <spectrum> to </spectrum> or <chromatogram> to </chromatogram> tag which contains one or more <binaryDataArray>. These XML tags need to conform to the mzML standard. The function will return a vector with all binary data found in the string in the binaryDataArray tags.

Parameters
inInput string containing the raw XML
data_Binary data extracted from the string
Precondition
in must have <spectrum> or <chromatogram> as root element.

◆ handleBinaryDataArray_()

void handleBinaryDataArray_ ( xercesc::DOMNode *  indexListNode,
std::vector< BinaryData > &  data_ 
)
protected

Convert a single DOMNode of type binaryDataArray to BinaryData object.

This function will extract the data from a xerces DOMNode which points to a binaryDataArray tag and store the result as a BinaryData object. The result will be appended to the data_ vector.

Parameters
inDOMNode of type binaryDataArray
data_Binary data extracted from the string

◆ setSkipXMLChecks()

void setSkipXMLChecks ( bool  only)

Whether to skip some XML checks (e.g. removing whitespace inside base64 arrays) and be fast instead.

Member Data Documentation

◆ skip_xml_checks_

bool skip_xml_checks_
protected

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:11 using doxygen 1.8.13