X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=seqsummarycommand.cpp;h=c0f91969eda2277e4c8b02c3a78db2a7390716fe;hb=4f9a6e14a608172f8a97f0297a3b8e6ea267c518;hp=8730997883ac5da6f8588e216f8311285303160d;hpb=32abf5d58aed8087cd0bcb32d7aa9053f103f2c1;p=mothur.git diff --git a/seqsummarycommand.cpp b/seqsummarycommand.cpp index 8730997..c0f9196 100644 --- a/seqsummarycommand.cpp +++ b/seqsummarycommand.cpp @@ -172,7 +172,7 @@ int SeqSummaryCommand::execute(){ vector ambigBases; vector longHomoPolymer; - if (namefile != "") { readNames(); } + if (namefile != "") { nameMap = m->readNames(namefile); } if (m->control_pressed) { return 0; } @@ -480,7 +480,7 @@ int SeqSummaryCommand::MPICreateSummary(int start, int num, vector& startPo //make sure this sequence is in the namefile, else error map::iterator it = nameMap.find(current.getName()); - if (it == nameMap.end()) { m->mothurOut("[ERROR]: " + current.getName() + " is not in your namefile, please correct."); m->mothurOutEndLine(); m->control_pressed = true; } + if (it == nameMap.end()) { cout << "[ERROR]: " << current.getName() << " is not in your namefile, please correct." << endl; m->control_pressed = true; } else { num = it->second; } } @@ -589,34 +589,6 @@ int SeqSummaryCommand::createProcessesCreateSummary(vector& startPosition, } } /**********************************************************************************************************************/ -int SeqSummaryCommand::readNames() { - try { - //open input file - ifstream in; - m->openInputFile(namefile, in); - - while (!in.eof()) { - if (m->control_pressed) { break; } - - string firstCol, secondCol; - in >> firstCol >> secondCol; m->gobble(in); - - int num = m->getNumNames(secondCol); - - nameMap[firstCol] = num; - } - in.close(); - - return 0; - - } - catch(exception& e) { - m->errorOut(e, "SeqSummaryCommand", "readNames"); - exit(1); - } -} - -/**********************************************************************************************************************/