mzml sample spectrum class
More...
#include <MzmlChromatogram.h>
|
| void | parse (xercesc::SAX2XMLReader *parser) |
| | parse XML data More...
|
| |
| virtual void | onGetXYData (kome::core::XYData *const xyData) |
| | This method is called by getXYData method (override method) More...
|
| |
| virtual void | onGetSpectra (kome::objects::DataSet &dataSet, const double startRt, const double endRt, const kome::objects::SearchType startSearch, const kome::objects::SearchType endSearch) |
| | This method is called by searchSpectrum or getSpectra method (overriede method) More...
|
| |
| virtual double | onGetMass (const unsigned int index) |
| | This method is called by getMass method (override method) More...
|
| |
| virtual int | onGetMsStage (const unsigned int index) |
| | This method is called by getMsStage method (override method) More...
|
| |
| virtual double | onGetPrecursor (const unsigned int index) |
| | This method is called by getPrecursor method (override method) More...
|
| |
mzml sample spectrum class
Definition at line 29 of file MzmlChromatogram.h.
| kome::io::mzml::MzmlChromatogram::MzmlChromatogram |
( |
MzmlSample * |
file | ) |
|
constructor
- Parameters
-
Definition at line 36 of file MzmlChromatogram.cpp.
37 : kome::objects::Chromatogram( file ) {
MzmlSample * m_mzmlSample
| long long kome::io::mzml::MzmlChromatogram::getOffset |
( |
| ) |
|
| double kome::io::mzml::MzmlChromatogram::onGetMass |
( |
const unsigned int |
index | ) |
|
|
protectedvirtual |
This method is called by getMass method (override method)
- Parameters
-
- Returns
- mass
Definition at line 172 of file MzmlChromatogram.cpp.
| int kome::io::mzml::MzmlChromatogram::onGetMsStage |
( |
const unsigned int |
index | ) |
|
|
protectedvirtual |
This method is called by getMsStage method (override method)
- Parameters
-
- Returns
- MS stage.
Definition at line 177 of file MzmlChromatogram.cpp.
| double kome::io::mzml::MzmlChromatogram::onGetPrecursor |
( |
const unsigned int |
index | ) |
|
|
protectedvirtual |
This method is called by getPrecursor method (override method)
- Parameters
-
- Returns
- precursor mass
Definition at line 182 of file MzmlChromatogram.cpp.
| void kome::io::mzml::MzmlChromatogram::onGetSpectra |
( |
kome::objects::DataSet & |
dataSet, |
|
|
const double |
startRt, |
|
|
const double |
endRt, |
|
|
const kome::objects::SearchType |
startSearch, |
|
|
const kome::objects::SearchType |
endSearc |
|
) |
| |
|
protectedvirtual |
This method is called by searchSpectrum or getSpectra method (overriede method)
- Parameters
-
| spectra | spectra object to store spectra |
| startRt | start RT |
| endRt | end RT |
| startSearch | start search type |
| endSearch | end search type |
Definition at line 162 of file MzmlChromatogram.cpp.
| void kome::io::mzml::MzmlChromatogram::onGetXYData |
( |
kome::core::XYData *const |
xyData | ) |
|
|
protectedvirtual |
This method is called by getXYData method (override method)
- Parameters
-
| xyData | object to store data points |
Definition at line 120 of file MzmlChromatogram.cpp.
122 if( xyData == NULL ) {
127 kome::core::DataPoints dps;
130 xercesc::SAX2XMLReader* parser = kome::xml::XercesTool::getParser( NULL );
131 parser->setFeature( xercesc::XMLUni::fgXercesSchema,
false );
132 parser->setFeature( xercesc::XMLUni::fgXercesSchemaFullChecking,
false );
137 parser->setContentHandler( &handler );
138 parser->setErrorHandler( &handler );
143 for(
unsigned int i = 0; i < dps.getLength(); i++ ) {
144 xyData->addPoint( dps.getX( i ), dps.getY( i ) );
147 catch(
const xercesc::XMLException& e ) {
148 LOG_ERROR( FMT(
"XML Exception: %s", kome::xml::XercesTool::transcode( e.getMessage() ).c_str() ) );
149 handler.setError(
true );
151 catch(
const xercesc::SAXParseException& e ) {
152 LOG_ERROR( FMT(
"SAX Parse Exception: %s", kome::xml::XercesTool::transcode( e.getMessage() ).c_str() ) );
153 handler.setError(
true );
156 LOG_ERROR( FMT(
"Unexpected Exception" ) );
157 handler.setError(
true );
MzmlSample * m_mzmlSample
XML data handler to get spectrum data points.
void parse(xercesc::SAX2XMLReader *parser)
parse XML data
| void kome::io::mzml::MzmlChromatogram::parse |
( |
xercesc::SAX2XMLReader * |
parser | ) |
|
|
protected |
parse XML data
- Parameters
-
Definition at line 57 of file MzmlChromatogram.cpp.
65 FILE* fp = sampleSet->
getFile();
75 int readSize = fread( buff, 1, 1023, fp );
79 buff[ readSize ] =
'\0';
84 unsigned int pos = tag.find(
"</chromatogram>" );
85 if( pos != (
unsigned int)tag.npos ) {
89 tag = tag.substr( 0, pos );
90 tag.append(
"</chromatogram>" );
94 if( readSize < 1023 ) {
99 unsigned int pos = tag.find(
"<chromatogram" );
100 if( pos != (
unsigned int)tag.npos ) {
101 tag = tag.substr( pos );
106 xercesc::MemBufInputSource source( (
const XMLByte*)tag.c_str(), tag.size(),
"memory_buffer", false );
107 parser->parse( source );
110 LOG_WARN( FMT(
"Failed to get the chromatogram tag." ) );
115 parser->parse( sampleSet->getFilePath() );
MzmlSampleSet * getMzmlSampleSet()
gets mzML sample set object
FILE * getFile()
gets file descriptor
| void kome::io::mzml::MzmlChromatogram::setOffset |
( |
const long long |
offset | ) |
|
| MzmlSample* kome::io::mzml::MzmlChromatogram::m_mzmlSample |
|
protected |
| long long kome::io::mzml::MzmlChromatogram::m_offset |
|
protected |
The documentation for this class was generated from the following files: