5 * Created by Thomas Ryabin on 4/24/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "readclustal.h"
14 /*******************************************************************************/
15 ReadClustal::ReadClustal(string file) : ReadSeqs(file){
19 cout << "Standard Error: " << e.what() << " has occurred in the ReadTree class Function ReadTree. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
23 cout << "An unknown error has occurred in the ReadTree class function ReadTree. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
27 /*******************************************************************************/
28 ReadClustal::~ReadClustal(){
29 // for(int i = 0; i < sequencedb.getNumSeqs(); i++)
30 // delete sequencedb.get(i);
32 /*******************************************************************************/
33 void ReadClustal::read() {
37 string firstName = "";
38 for(int i = 0; i < 6; i++)
43 int lastSeqLength = 0;
44 bool firstDone = false;
46 while(!filehandle.eof()) {
52 else if(!firstDone && firstName.compare("") == 0)
54 else if(!firstDone && firstName.compare(name) == 0) {
60 if(name.find_first_of("*") == -1) {
61 filehandle >> sequence;
62 lastSeqLength = sequence.length();
64 Sequence newSeq(name, sequence);
65 sequencedb.add(newSeq);
68 sequencedb.set(count, sequencedb.get(count).getUnaligned() + sequence);
74 sequencedb.set(0, sequencedb.get(0).getUnaligned().substr(0, sequencedb.get(0).getUnaligned().length() - lastSeqLength));
79 /*********************************************************************************/
80 SequenceDB* ReadClustal::getDB() {