X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=classifyseqscommand.cpp;h=bbdf8119ad9332f49be4b1c71679b50fc51fe68d;hb=15cde0905641f8adddc1cc704f8c064f760e7461;hp=b8d5b8efdc1d086a556c6ff0ea07332fd4470cf8;hpb=191ae1be0679d5cf4eda950b3b1bf26fb7dd503d;p=mothur.git diff --git a/classifyseqscommand.cpp b/classifyseqscommand.cpp index b8d5b8e..bbdf811 100644 --- a/classifyseqscommand.cpp +++ b/classifyseqscommand.cpp @@ -559,16 +559,6 @@ int ClassifySeqsCommand::execute(){ numFastaSeqs = createProcesses(newTaxonomyFile, tempTaxonomyFile, fastaFileNames[s]); - rename((newTaxonomyFile + toString(processIDS[0]) + ".temp").c_str(), newTaxonomyFile.c_str()); - rename((tempTaxonomyFile + toString(processIDS[0]) + ".temp").c_str(), tempTaxonomyFile.c_str()); - - for(int i=1;imothurOut("unable to spawn the necessary processes."); m->mothurOutEndLine(); exit(0); } + }else { + m->mothurOut("[ERROR]: unable to spawn the necessary processes."); m->mothurOutEndLine(); + for (int i = 0; i < processIDS.size(); i++) { kill (processIDS[i], SIGINT); } + exit(0); + } } + //parent does its part + num = driver(lines[0], taxFileName, tempTaxFile, filename); + //force parent to wait until all the processes are done - for (int i=0;icontrol_pressed) { return 0; } Sequence* candidateSeq = new Sequence(inFASTA); m->gobble(inFASTA); - + if (candidateSeq->getName() != "") { + taxonomy = classify->getTaxonomy(candidateSeq); if (m->control_pressed) { delete candidateSeq; return 0; } @@ -859,10 +864,11 @@ int ClassifySeqsCommand::driver(linePair* filePos, string taxFName, string tempT //report progress if((count) % 100 == 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine(); } + } //report progress if((count) % 100 != 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine(); } - + inFASTA.close(); outTax.close(); outTaxSimple.close();