]> git.donarmstrong.com Git - mothur.git/blobdiff - removelineagecommand.cpp
added summary output to catchall command
[mothur.git] / removelineagecommand.cpp
index 557622db59b1f5480a87fda36050e98cfb9439a9..1a3de32088d3bf1351b1005c654ac612fcd27732 100644 (file)
@@ -26,6 +26,7 @@ vector<string> RemoveLineageCommand::getValidParameters(){
 //**********************************************************************************************************************
 RemoveLineageCommand::RemoveLineageCommand(){  
        try {
+               abort = true;
                //initialize outputTypes
                vector<string> tempOutNames;
                outputTypes["fasta"] = tempOutNames;
@@ -180,7 +181,11 @@ RemoveLineageCommand::RemoveLineageCommand(string option)  {
                        else if (taxfile == "not found") {  taxfile = ""; m->mothurOut("The taxonomy parameter is required for the get.lineage command."); m->mothurOutEndLine();  abort = true; }
                        
                        string usedDups = "true";
-                       string temp = validParameter.validFile(parameters, "dups", false);      if (temp == "not found") { temp = "false"; usedDups = ""; }
+                       string temp = validParameter.validFile(parameters, "dups", false);      
+                       if (temp == "not found") { 
+                               if (namefile != "") {  temp = "true";                                   }
+                               else                            {  temp = "false"; usedDups = "";       }
+                       }
                        dups = m->isTrue(temp);
                        
                        taxons = validParameter.validFile(parameters, "taxon", false);  
@@ -297,7 +302,7 @@ int RemoveLineageCommand::readFasta(){
                out.close();
                
                if (wroteSomething == false) {  m->mothurOut("Your fasta file contains only sequences from " + taxons + "."); m->mothurOutEndLine();  }
-               outputTypes["fasta"].push_back(outputFileName); 
+               outputNames.push_back(outputFileName); outputTypes["fasta"].push_back(outputFileName); 
                
                return 0;
                
@@ -368,7 +373,7 @@ int RemoveLineageCommand::readList(){
                out.close();
                
                if (wroteSomething == false) {  m->mothurOut("Your list file contains only sequences from " + taxons + "."); m->mothurOutEndLine();  }
-               outputTypes["list"].push_back(outputFileName); 
+               outputNames.push_back(outputFileName); outputTypes["list"].push_back(outputFileName); 
                                
                return 0;
 
@@ -454,7 +459,7 @@ int RemoveLineageCommand::readName(){
                out.close();
 
                if (wroteSomething == false) {  m->mothurOut("Your name file contains only sequences from " + taxons + "."); m->mothurOutEndLine();  }
-               outputTypes["name"].push_back(outputFileName);
+               outputNames.push_back(outputFileName); outputTypes["name"].push_back(outputFileName);
                                
                return 0;
        }
@@ -498,7 +503,7 @@ int RemoveLineageCommand::readGroup(){
                out.close();
                
                if (wroteSomething == false) {  m->mothurOut("Your group file contains only sequences from " + taxons + "."); m->mothurOutEndLine();  }
-               outputTypes["group"].push_back(outputFileName);
+               outputNames.push_back(outputFileName); outputTypes["group"].push_back(outputFileName);
                
                return 0;
        }
@@ -552,7 +557,7 @@ int RemoveLineageCommand::readTax(){
                out.close();
                
                if (!wroteSomething) { m->mothurOut("Your taxonomy file contains only sequences from " + taxons + "."); m->mothurOutEndLine();  }
-               outputTypes["taxonomy"].push_back(outputFileName);
+               outputNames.push_back(outputFileName); outputTypes["taxonomy"].push_back(outputFileName);
                        
                return 0;
 
@@ -642,7 +647,7 @@ int RemoveLineageCommand::readAlign(){
                out.close();
                
                if (wroteSomething == false) {  m->mothurOut("Your align file contains only sequences from " + taxons + "."); m->mothurOutEndLine();  }
-               outputTypes["alignreport"].push_back(outputFileName);
+               outputNames.push_back(outputFileName); outputTypes["alignreport"].push_back(outputFileName);
                
                return 0;