#include "listvector.hpp"
//**********************************************************************************************************************
-
+vector<string> RemoveLineageCommand::getValidParameters(){
+ try {
+ string Array[] = {"fasta","name", "group", "alignreport", "taxon", "dups", "list","taxonomy","outputdir","inputdir"};
+ vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "RemoveLineageCommand", "getValidParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+RemoveLineageCommand::RemoveLineageCommand(){
+ try {
+ abort = true;
+ //initialize outputTypes
+ vector<string> tempOutNames;
+ outputTypes["fasta"] = tempOutNames;
+ outputTypes["taxonomy"] = tempOutNames;
+ outputTypes["name"] = tempOutNames;
+ outputTypes["group"] = tempOutNames;
+ outputTypes["alignreport"] = tempOutNames;
+ outputTypes["list"] = tempOutNames;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "RemoveLineageCommand", "RemoveLineageCommand");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+vector<string> RemoveLineageCommand::getRequiredParameters(){
+ try {
+ string Array[] = {"taxonomy"};
+ vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "RemoveLineageCommand", "getRequiredParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+vector<string> RemoveLineageCommand::getRequiredFiles(){
+ try {
+ vector<string> myArray;
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "RemoveLineageCommand", "getRequiredFiles");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
RemoveLineageCommand::RemoveLineageCommand(string option) {
try {
abort = false;
if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; }
}
+ //initialize outputTypes
+ vector<string> tempOutNames;
+ outputTypes["fasta"] = tempOutNames;
+ outputTypes["taxonomy"] = tempOutNames;
+ outputTypes["name"] = tempOutNames;
+ outputTypes["group"] = tempOutNames;
+ outputTypes["alignreport"] = tempOutNames;
+ outputTypes["list"] = tempOutNames;
+
//if the user changes the output directory command factory will send this info to us in the output parameter
outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ outputDir = ""; }
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);
out.close();
if (wroteSomething == false) { m->mothurOut("Your fasta file contains only sequences from " + taxons + "."); m->mothurOutEndLine(); }
- outputNames.push_back(outputFileName);
+ outputNames.push_back(outputFileName); outputTypes["fasta"].push_back(outputFileName);
return 0;
out.close();
if (wroteSomething == false) { m->mothurOut("Your list file contains only sequences from " + taxons + "."); m->mothurOutEndLine(); }
- outputNames.push_back(outputFileName);
+ outputNames.push_back(outputFileName); outputTypes["list"].push_back(outputFileName);
return 0;
out.close();
if (wroteSomething == false) { m->mothurOut("Your name file contains only sequences from " + taxons + "."); m->mothurOutEndLine(); }
- outputNames.push_back(outputFileName);
+ outputNames.push_back(outputFileName); outputTypes["name"].push_back(outputFileName);
return 0;
}
out.close();
if (wroteSomething == false) { m->mothurOut("Your group file contains only sequences from " + taxons + "."); m->mothurOutEndLine(); }
- outputNames.push_back(outputFileName);
+ outputNames.push_back(outputFileName); outputTypes["group"].push_back(outputFileName);
return 0;
}
out.close();
if (!wroteSomething) { m->mothurOut("Your taxonomy file contains only sequences from " + taxons + "."); m->mothurOutEndLine(); }
- outputNames.push_back(outputFileName);
+ outputNames.push_back(outputFileName); outputTypes["taxonomy"].push_back(outputFileName);
return 0;
out.close();
if (wroteSomething == false) { m->mothurOut("Your align file contains only sequences from " + taxons + "."); m->mothurOutEndLine(); }
- outputNames.push_back(outputFileName);
+ outputNames.push_back(outputFileName); outputTypes["alignreport"].push_back(outputFileName);
return 0;