]> git.donarmstrong.com Git - mothur.git/blobdiff - getgroupscommand.cpp
rewrote metastats command in c++, added mothurRemove function to handle ~ error....
[mothur.git] / getgroupscommand.cpp
index 1ba8aa7bd6d2e8df8fbc513272c7784cafd3bc67..0065ec1fc152b24a0bf4d78b2bd5f06a12f859be 100644 (file)
@@ -243,7 +243,7 @@ int GetGroupsCommand::execute(){
                if (listfile != "")                     {               readList();             }
                if (taxfile != "")                      {               readTax();              }
                
-               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; }
                
                m->mothurOut("Selected " + toString(names.size()) + " sequences. From the groups: "); m->mothurOutEndLine();
                for (int i = 0; i < Groups.size(); i++) {       m->mothurOut(Groups[i]); m->mothurOut("\t" + toString(groupMap->getNumSeqs(Groups[i]))); m->mothurOutEndLine(); }
@@ -309,7 +309,7 @@ int GetGroupsCommand::readFasta(){
                bool wroteSomething = false;
                
                while(!in.eof()){
-                       if (m->control_pressed) { in.close();  out.close();  remove(outputFileName.c_str());  return 0; }
+                       if (m->control_pressed) { in.close();  out.close();  m->mothurRemove(outputFileName);  return 0; }
                        
                        Sequence currSeq(in);
                        name = currSeq.getName();
@@ -364,7 +364,7 @@ int GetGroupsCommand::readList(){
                        
                        //for each bin
                        for (int i = 0; i < list.getNumBins(); i++) {
-                               if (m->control_pressed) { in.close();  out.close();  remove(outputFileName.c_str());  return 0; }
+                               if (m->control_pressed) { in.close();  out.close();  m->mothurRemove(outputFileName);  return 0; }
                                
                                //parse out names that are in accnos file
                                string binnames = list.get(i);
@@ -427,7 +427,7 @@ int GetGroupsCommand::readName(){
                bool wroteSomething = false;
                
                while(!in.eof()){
-                       if (m->control_pressed) { in.close();  out.close();  remove(outputFileName.c_str());  return 0; }
+                       if (m->control_pressed) { in.close();  out.close();  m->mothurRemove(outputFileName);  return 0; }
                        
                        in >> firstCol;         m->gobble(in);          
                        in >> secondCol;                        
@@ -502,7 +502,7 @@ int GetGroupsCommand::readGroup(){
                bool wroteSomething = false;
                
                while(!in.eof()){
-                       if (m->control_pressed) { in.close();  out.close();  remove(outputFileName.c_str());  return 0; }
+                       if (m->control_pressed) { in.close();  out.close();  m->mothurRemove(outputFileName);  return 0; }
                        
                        in >> name;                             //read from first column
                        in >> group;                    //read from second column
@@ -544,7 +544,7 @@ int GetGroupsCommand::readTax(){
                bool wroteSomething = false;
                
                while(!in.eof()){
-                       if (m->control_pressed) { in.close();  out.close();  remove(outputFileName.c_str());  return 0; }
+                       if (m->control_pressed) { in.close();  out.close();  m->mothurRemove(outputFileName);  return 0; }
                        
                        in >> name;                             //read from first column
                        in >> tax;                      //read from second column