#include <fstream>
/*******************************************************************************/
-ReadFasta::ReadFasta(string file) {
+ReadFasta::ReadFasta(string file) : ReadSeqs(file) {
try {
- openInputFile(file, filehandle);
- fastaFile = file;
- globaldata = GlobalData::getInstance();
}
catch(exception& e) {
cout << "Standard Error: " << e.what() << " has occurred in the ReadTree class Function ReadTree. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
string sequence = "";
string temp;
int count = 0;
+
while(!filehandle.eof()){
if(count == 0)
filehandle >> temp;
count++;
name = temp.substr(1,temp.length()-1);
}
- else
+ else {
sequence += temp;
+ }
filehandle >> temp;
+ gobble(filehandle);
+
+ if(filehandle.eof())
+ sequence += temp;
+
}
Sequence newSequence(name, sequence);
sequencedb.add(newSequence);