]> git.donarmstrong.com Git - mothur.git/blobdiff - getrabundcommand.cpp
added sort parameter to get.otulist
[mothur.git] / getrabundcommand.cpp
index 5a192c5066d6f23921e356ed7a2785abbd967631..b665c88cdede4273b1aadd5bf1d4ee21ddec6b85 100644 (file)
@@ -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<string> processedLabels;
                set<string> 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;               
        }