+ vector<string> myArray;
+ for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); }
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "GetSeqsCommand", "setParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+string GetSeqsCommand::getHelpString(){
+ try {
+ string helpString = "";
+ helpString += "The get.seqs command reads an .accnos file and any of the following file types: fasta, name, group, count, list, taxonomy, quality or alignreport file.\n";
+ helpString += "It outputs a file containing only the sequences in the .accnos file.\n";
+ helpString += "The get.seqs command parameters are accnos, fasta, name, group, list, taxonomy, qfile, alignreport and dups. You must provide accnos unless you have a valid current accnos file, and at least one of the other parameters.\n";
+ helpString += "The dups parameter allows you to add the entire line from a name file if you add any name from the line. default=false. \n";
+ helpString += "The get.seqs command should be in the following format: get.seqs(accnos=yourAccnos, fasta=yourFasta).\n";
+ helpString += "Example get.seqs(accnos=amazon.accnos, fasta=amazon.fasta).\n";
+ helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n";
+ return helpString;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "GetSeqsCommand", "getHelpString");
+ exit(1);
+ }
+}
+
+//**********************************************************************************************************************
+GetSeqsCommand::GetSeqsCommand(){
+ try {
+ abort = true; calledHelp = true;
+ setParameters();
+ vector<string> tempOutNames;
+ outputTypes["fasta"] = tempOutNames;
+ outputTypes["taxonomy"] = tempOutNames;
+ outputTypes["name"] = tempOutNames;
+ outputTypes["group"] = tempOutNames;
+ outputTypes["alignreport"] = tempOutNames;
+ outputTypes["list"] = tempOutNames;
+ outputTypes["qfile"] = tempOutNames;
+ outputTypes["count"] = tempOutNames;
+ outputTypes["accnosreport"] = tempOutNames;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "GetSeqsCommand", "GetSeqsCommand");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+string GetSeqsCommand::getOutputFileNameTag(string type, string inputName=""){
+ try {
+ string outputFileName = "";
+ map<string, vector<string> >::iterator it;
+
+ //is this a type this command creates
+ it = outputTypes.find(type);
+ if (it == outputTypes.end()) { m->mothurOut("[ERROR]: this command doesn't create a " + type + " output file.\n"); }
+ else {
+ if (type == "fasta") { outputFileName = "pick" + m->getExtension(inputName); }
+ else if (type == "taxonomy") { outputFileName = "pick" + m->getExtension(inputName); }
+ else if (type == "name") { outputFileName = "pick" + m->getExtension(inputName); }
+ else if (type == "count") { outputFileName = "pick.count_table"; }
+ else if (type == "group") { outputFileName = "pick" + m->getExtension(inputName); }
+ else if (type == "list") { outputFileName = "pick" + m->getExtension(inputName); }
+ else if (type == "qfile") { outputFileName = "pick" + m->getExtension(inputName); }
+ else if (type == "accnosreport"){ outputFileName = "accnos.report"; }
+ else if (type == "alignreport") { outputFileName = "pick.align.report"; }
+ else { m->mothurOut("[ERROR]: No definition for type " + type + " output file tag.\n"); m->control_pressed = true; }
+ }
+ return outputFileName;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "GetSeqsCommand", "getOutputFileNameTag");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************