5 * Created by Thomas Ryabin on 4/22/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "readnexus.h"
14 /*******************************************************************************/
15 ReadNexus::ReadNexus(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 ReadNexus::~ReadNexus(){
29 // for(int i = 0; i < sequencedb.getNumSeqs(); i++)
30 // delete sequencedb.get(i);
32 /*******************************************************************************/
33 void ReadNexus::read() {
37 for(int i = 0; i < 5; i++)
40 int numSeqs = atoi(temp.substr(temp.find_first_of("=")+1, temp.length() - temp.find_first_of("=") - 1).c_str());
42 for(int i = 0; i < 9; i++)
46 bool firstDone = false;
47 while(!filehandle.eof()){
49 filehandle >> sequence;
50 if(name.compare(";") != 0) {
52 Sequence newSeq(name, sequence);
53 sequencedb.add(newSeq);
56 sequencedb.set(count, sequencedb.get(count).getUnaligned() + sequence);
59 if(count == numSeqs) {
69 /*********************************************************************************/
70 SequenceDB* ReadNexus::getDB() {