#include <phdparser.h>
Public Member Functions | |
PhdParser (std::string infile) | |
TrapperVector< Q_UINT32 > | parse () |
Private Attributes | |
std::string | filename |
Definition at line 7 of file phdparser.h.
|
|
|
Definition at line 12 of file phdparser.cc. References filename, and TrapperVector< T >::stlVector(). Referenced by TrapperDoc::importPhd(). 00013 { 00014 TrapperVector<Q_UINT32> phd; 00015 00016 string line; 00017 00018 ifstream inFile(filename.c_str()); 00019 00020 while ( getline(inFile, line) ) { 00021 if ( line == "BEGIN_DNA" ) break; 00022 } 00023 while ( getline(inFile, line) ) { 00024 if ( line == "END_DNA" ) break; 00025 00026 istringstream is(line); 00027 char base; 00028 size_t qual; 00029 size_t index; 00030 if ( !(is>>base && is>>qual && is>>index) ) { 00031 cerr<<"PhdParser::parse(), input error"<<endl; 00032 cerr<<"Line is ill formated"<<endl; 00033 cerr<<line<<endl; 00034 return TrapperVector<Q_UINT32>(); 00035 } 00036 phd.stlVector().push_back(index); 00037 00038 } 00039 inFile.close(); 00040 return phd; 00041 }
|
|
Definition at line 15 of file phdparser.h. Referenced by parse(). |