X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=phylotypecommand.cpp;h=410ada9e4ec921fd8f0ba3ddb5aa362fd0390995;hp=e3b47d863f3803b4d6d1ae7355a863b540f776c5;hb=aa9238c0a9e6e7aa0ed8b8b606b08ad4fd7dcfe3;hpb=182db2b6f1747bc1e0b8cd3eceec8751abdd31d5 diff --git a/phylotypecommand.cpp b/phylotypecommand.cpp index e3b47d8..410ada9 100644 --- a/phylotypecommand.cpp +++ b/phylotypecommand.cpp @@ -121,6 +121,8 @@ int PhylotypeCommand::execute(){ //make it as long as the longest taxonomy in the file TaxEqualizer* taxEqual = new TaxEqualizer(taxonomyFileName, cutoff); + if (m->control_pressed) { delete taxEqual; return 0; } + string equalizedTaxFile = taxEqual->getEqualizedTaxFile(); delete taxEqual; @@ -135,6 +137,8 @@ int PhylotypeCommand::execute(){ bool done = false; if (tree->get(leaves[0]).parent == -1) { m->mothurOut("Empty Tree"); m->mothurOutEndLine(); done = true; } + if (m->control_pressed) { delete tree; return 0; } + string fileroot = outputDir + getRootName(getSimpleName(taxonomyFileName)); ofstream outList; @@ -158,6 +162,12 @@ int PhylotypeCommand::execute(){ string level = toString(count); count++; + if (m->control_pressed) { + outRabund.close(); outSabund.close(); outList.close(); + for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } + delete tree; return 0; + } + //is this a level the user want output for if(allLines == 1 || labels.count(level) == 1){ @@ -216,6 +226,11 @@ int PhylotypeCommand::execute(){ delete tree; + if (m->control_pressed) { + for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } + return 0; + } + m->mothurOutEndLine(); m->mothurOut("Output File Names: "); m->mothurOutEndLine(); for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); }