5 * Created by Thomas Ryabin on 4/21/09.
6 * Copyright 2009 __MyCompanyName__. All rights reserved.
10 #include "readfasta.h"
14 /*******************************************************************************/
15 ReadFasta::ReadFasta(string file) {
17 openInputFile(file, filehandle);
19 globaldata = GlobalData::getInstance();
22 cout << "Standard Error: " << e.what() << " has occurred in the ReadTree class Function ReadTree. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
26 cout << "An unknown error has occurred in the ReadTree class function ReadTree. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
30 /*******************************************************************************/
31 ReadFasta::~ReadFasta(){
32 //for(int i = 0; i < sequencedb.getNumSeqs(); i++)
33 //delete sequencedb.get(i);
35 /*******************************************************************************/
36 void ReadFasta::read() {
41 while(!filehandle.eof()){
44 if(temp.substr(0,1).compare(">") == 0) {
46 Sequence newSequence(name, sequence);
47 sequencedb.add(newSequence);
52 name = temp.substr(1,temp.length()-1);
59 Sequence newSequence(name, sequence);
60 sequencedb.add(newSequence);
65 /*********************************************************************************/
66 SequenceDB* ReadFasta::getDB() {