X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=getrabundcommand.cpp;h=b665c88cdede4273b1aadd5bf1d4ee21ddec6b85;hb=f07bf12e0d04340698aff7a36d2fee7c959ffe59;hp=5a192c5066d6f23921e356ed7a2785abbd967631;hpb=74844a60d80c6dd06e3fb02ee9b928424f9019b0;p=mothur.git diff --git a/getrabundcommand.cpp b/getrabundcommand.cpp index 5a192c5..b665c88 100644 --- a/getrabundcommand.cpp +++ b/getrabundcommand.cpp @@ -99,9 +99,7 @@ void GetRAbundCommand::help(){ //********************************************************************************************************************** -GetRAbundCommand::~GetRAbundCommand(){ - if (abort == false) { globaldata->gListVector = NULL; } -} +GetRAbundCommand::~GetRAbundCommand(){} //********************************************************************************************************************** @@ -122,6 +120,8 @@ int GetRAbundCommand::execute(){ set processedLabels; set userLabels = labels; + if (m->control_pressed) { out.close(); remove(filename.c_str()); delete list; globaldata->gListVector = NULL; return 0; } + while((list != NULL) && ((allLines == 1) || (userLabels.size() != 0))) { if(allLines == 1 || labels.count(list->getLabel()) == 1){ @@ -129,6 +129,9 @@ int GetRAbundCommand::execute(){ rabund = new RAbundVector(); *rabund = (list->getRAbundVector()); + if (m->control_pressed) { out.close(); remove(filename.c_str()); delete list; delete rabund; globaldata->gListVector = NULL; return 0; } + + if(sorted) { rabund->print(out); } else { rabund->nonSortedPrint(out); } @@ -148,6 +151,8 @@ int GetRAbundCommand::execute(){ rabund = new RAbundVector(); *rabund = (list->getRAbundVector()); + if (m->control_pressed) { out.close(); remove(filename.c_str()); delete list; delete rabund; globaldata->gListVector = NULL; return 0; } + if(sorted) { rabund->print(out); } else { rabund->nonSortedPrint(out); } @@ -188,6 +193,8 @@ int GetRAbundCommand::execute(){ rabund = new RAbundVector(); *rabund = (list->getRAbundVector()); + if (m->control_pressed) { out.close(); remove(filename.c_str()); delete list; delete rabund; globaldata->gListVector = NULL; return 0; } + if(sorted) { rabund->print(out); } else { rabund->nonSortedPrint(out); } @@ -199,9 +206,11 @@ int GetRAbundCommand::execute(){ m->mothurOut("Output File Name: "); m->mothurOutEndLine(); m->mothurOut(filename); m->mothurOutEndLine(); m->mothurOutEndLine(); - out.close(); + + globaldata->gListVector = NULL; + return 0; }