]> git.donarmstrong.com Git - mothur.git/blobdiff - removeseqscommand.cpp
another attempt to fix sffinfo
[mothur.git] / removeseqscommand.cpp
index 35d9bea3aa07255f872e5c7cbe195bd720a531ba..afd9dd4acf22e8fc417fd6aeacb507a120987db8 100644 (file)
@@ -236,10 +236,8 @@ int RemoveSeqsCommand::readFasta(){
                in.close();     
                out.close();
                
-               if (wroteSomething == false) {
-                       m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();
-                       remove(outputFileName.c_str()); 
-               }else { outputNames.push_back(outputFileName); }
+               if (wroteSomething == false) {  m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();  }
+               outputNames.push_back(outputFileName); 
                
                return 0;
                
@@ -307,11 +305,9 @@ int RemoveSeqsCommand::readList(){
                in.close();     
                out.close();
                
-               if (wroteSomething == false) {
-                       m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();
-                       remove(outputFileName.c_str()); 
-               }else { outputNames.push_back(outputFileName); }
-               
+               if (wroteSomething == false) {  m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();  }
+               outputNames.push_back(outputFileName); 
+                               
                return 0;
 
        }
@@ -334,7 +330,7 @@ int RemoveSeqsCommand::readName(){
                string name, firstCol, secondCol;
                
                bool wroteSomething = false;
-       int numSeqsInNames = 0; 
+               
                while(!in.eof()){
                        if (m->control_pressed) { in.close();  out.close();  remove(outputFileName.c_str());  return 0; }
 
@@ -359,7 +355,7 @@ int RemoveSeqsCommand::readName(){
                                        validSecond.push_back(parsedNames[i]);
                                }
                        }
-               numSeqsInNames += parsedNames.size();   
+                       
                        if ((dups) && (validSecond.size() != parsedNames.size())) {  //if dups is true and we want to get rid of anyone, get rid of everyone
                                for (int i = 0; i < parsedNames.size(); i++) {  names.insert(parsedNames[i]);  }
                        }else {
@@ -394,12 +390,10 @@ int RemoveSeqsCommand::readName(){
                }
                in.close();
                out.close();
-cout << "your names file contains " << numSeqsInNames << endl;         
-               if (wroteSomething == false) {
-                       m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();
-                       remove(outputFileName.c_str()); 
-               }else { outputNames.push_back(outputFileName); }
-               
+
+               if (wroteSomething == false) {  m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();  }
+               outputNames.push_back(outputFileName); 
+                               
                return 0;
        }
        catch(exception& e) {
@@ -439,10 +433,8 @@ int RemoveSeqsCommand::readGroup(){
                in.close();
                out.close();
                
-               if (wroteSomething == false) {
-                       m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();
-                       remove(outputFileName.c_str()); 
-               }else { outputNames.push_back(outputFileName); }
+               if (wroteSomething == false) {  m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();  }
+               outputNames.push_back(outputFileName); 
                
                return 0;
        }
@@ -482,10 +474,8 @@ int RemoveSeqsCommand::readTax(){
                in.close();
                out.close();
                
-               if (wroteSomething == false) {
-                       m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();
-                       remove(outputFileName.c_str()); 
-               }else { outputNames.push_back(outputFileName); }
+               if (wroteSomething == false) {  m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();  }
+               outputNames.push_back(outputFileName); 
                
                return 0;
        }
@@ -548,10 +538,8 @@ int RemoveSeqsCommand::readAlign(){
                in.close();
                out.close();
                
-               if (wroteSomething == false) {
-                       m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();
-                       remove(outputFileName.c_str()); 
-               }else { outputNames.push_back(outputFileName); }
+               if (wroteSomething == false) {  m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();  }
+               outputNames.push_back(outputFileName); 
                
                return 0;