* Mothur
*
* Created by Thomas Ryabin on 4/24/09.
- * Copyright 2009 __MyCompanyName__. All rights reserved.
+ * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
*
*/
#include <fstream>
/*******************************************************************************/
-ReadClustal::ReadClustal(string file) {
+ReadClustal::ReadClustal(string file) : ReadSeqs(file){
try {
- openInputFile(file, filehandle);
- clustalFile = 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";
int count = 0;
int numSeqs = 0;
+ int lastSeqLength = 0;
bool firstDone = false;
while(!filehandle.eof()) {
if(name.find_first_of("*") == -1) {
filehandle >> sequence;
+ lastSeqLength = sequence.length();
if(!firstDone) {
Sequence newSeq(name, sequence);
sequencedb.add(newSeq);
}
else
- sequencedb.set(count, sequencedb.get(count).getAligned() + sequence);
+ sequencedb.set(count, sequencedb.get(count).getUnaligned() + sequence);
count++;
}
}
+ if(count == 1)
+ sequencedb.set(0, sequencedb.get(0).getUnaligned().substr(0, sequencedb.get(0).getUnaligned().length() - lastSeqLength));
+
filehandle.close();
}