]> git.donarmstrong.com Git - mothur.git/blobdiff - splitabundcommand.cpp
added check to make sure shhh.flows child processes finish properly. added subsamplin...
[mothur.git] / splitabundcommand.cpp
index aa47940a030f968e02686b915d26e84c29584b8d..8131fa9195f6b8d939b27891605dd862d618964b 100644 (file)
@@ -181,7 +181,7 @@ SplitAbundCommand::SplitAbundCommand(string option)  {
                        groups = validParameter.validFile(parameters, "groups", false);         
                        if (groups == "not found") { groups = ""; }
                        else if (groups == "all") { 
-                               if (groupfile != "") {  Groups = groupMap->namesOfGroups;  } 
+                               if (groupfile != "") {  Groups = groupMap->getNamesOfGroups();  } 
                                else {  m->mothurOut("You cannot select groups without a valid groupfile, I will disregard your groups selection. "); m->mothurOutEndLine(); groups = "";   }
                        }else { 
                                m->splitAtDash(groups, Groups);
@@ -213,10 +213,9 @@ SplitAbundCommand::SplitAbundCommand(string option)  {
                        accnos = m->isTrue(temp); 
                        
                        temp = validParameter.validFile(parameters, "cutoff", false);                           if (temp == "not found") { temp = "0"; }
-                       convert(temp, cutoff); 
+                       m->mothurConvert(temp, cutoff); 
 
                        if (cutoff == 0) {  m->mothurOut("You must provide a cutoff to qualify what is abundant for the split.abund command. "); m->mothurOutEndLine(); abort = true;  }
-
                }
 
        }
@@ -250,11 +249,11 @@ int SplitAbundCommand::execute(){
                        if (namefile != "") {  readNamesFile();         }
                        else                            { createNameMap(list);  }
                        
-                       if (m->control_pressed) { delete input; delete list; for (int i = 0; i < outputNames.size(); i++) {     remove(outputNames[i].c_str()); } return 0; }
+                       if (m->control_pressed) { delete input; delete list; for (int i = 0; i < outputNames.size(); i++) {     m->mothurRemove(outputNames[i]); } return 0; }
                        
                        while((list != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
                        
-                               if (m->control_pressed) { delete input; delete list; for (int i = 0; i < outputNames.size(); i++) {     remove(outputNames[i].c_str()); } return 0; }
+                               if (m->control_pressed) { delete input; delete list; for (int i = 0; i < outputNames.size(); i++) {     m->mothurRemove(outputNames[i]); } return 0; }
                                
                                if(allLines == 1 || labels.count(list->getLabel()) == 1){
                                                
@@ -288,7 +287,7 @@ int SplitAbundCommand::execute(){
                                list = input->getListVector(); //get new list vector to process
                        }
                        
-                       if (m->control_pressed) { delete input;  for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
+                       if (m->control_pressed) { delete input;  for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } return 0; }
                        
                        //output error messages about any remaining user labels
                        set<string>::iterator it;
@@ -304,7 +303,7 @@ int SplitAbundCommand::execute(){
 
                        }
                        
-                       if (m->control_pressed) { delete input;  for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
+                       if (m->control_pressed) { delete input;  for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } return 0; }
                        
                        //run last label if you need to
                        if (needToRun == true)  {
@@ -319,7 +318,7 @@ int SplitAbundCommand::execute(){
                        
                        delete input;
                        
-                       if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) {        remove(outputNames[i].c_str()); }       return 0;       }
+                       if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) {        m->mothurRemove(outputNames[i]); }      return 0;       }
                                                                        
                }else { //you are using the namefile to determine abundance
                        if (outputDir == "") { outputDir = m->hasPath(namefile); }