X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=ccode.cpp;h=00cd3f1948e009a86456e32bbcde2a40c6f889ac;hp=15e482a505494574dddbe56f995d3880e9557ac0;hb=b206f634aae1b4ce13978d203247fb64757d5482;hpb=260ae19c36cb11a53ddc5a75b5e507f8dd8b31d6 diff --git a/ccode.cpp b/ccode.cpp index 15e482a..00cd3f1 100644 --- a/ccode.cpp +++ b/ccode.cpp @@ -11,12 +11,13 @@ #include "ignoregaps.h" #include "eachgapdist.h" - //*************************************************************************************************************** Ccode::Ccode(string filename, string temp, bool f, string mask, int win, int numW, string o) : Chimera() { + try { + fastafile = filename; outputDir = o; - templateFileName = temp; templateSeqs = readSeqs(temp); + templateFileName = temp; templateSeqs = readSeqs(temp); setMask(mask); filter = f; window = win; @@ -63,6 +64,11 @@ Ccode::Ccode(string filename, string temp, bool f, string mask, int win, int num out2 << "Place in masked, filtered and trimmed sequence\tPlace in original alignment" << endl; out2.close(); #endif + } + catch(exception& e) { + m->errorOut(e, "Ccode", "Ccode"); + exit(1); + } } //*************************************************************************************************************** Ccode::~Ccode() { @@ -74,7 +80,7 @@ Ccode::~Ccode() { #endif } //*************************************************************************************************************** -int Ccode::print(ostream& out, ostream& outAcc) { +Sequence Ccode::print(ostream& out, ostream& outAcc) { try { ofstream out2; @@ -155,7 +161,7 @@ int Ccode::print(ostream& out, ostream& outAcc) { //free memory for (int i = 0; i < closest.size(); i++) { delete closest[i].seq; } - return results; + return *querySeq; } catch(exception& e) { m->errorOut(e, "Ccode", "print"); @@ -164,7 +170,7 @@ int Ccode::print(ostream& out, ostream& outAcc) { } #ifdef USE_MPI //*************************************************************************************************************** -int Ccode::print(MPI_File& out, MPI_File& outAcc) { +Sequence Ccode::print(MPI_File& out, MPI_File& outAcc) { try { string outMapString = ""; @@ -263,7 +269,7 @@ int Ccode::print(MPI_File& out, MPI_File& outAcc) { //free memory for (int i = 0; i < closest.size(); i++) { delete closest[i].seq; } - return results; + return *querySeq; } catch(exception& e) { m->errorOut(e, "Ccode", "print"); @@ -280,6 +286,8 @@ int Ccode::printMapping(string& output) { MPI_File_write_shared(outMap, buf, length, MPI_CHAR, &status); delete buf; + + return 0; } catch(exception& e) {