+
+//**********************************************************************************************************************
+vector<string> SeqSummaryCommand::setParameters(){
+ try {
+ CommandParameter pfasta("fasta", "InputTypes", "", "", "none", "none", "none",false,true); parameters.push_back(pfasta);
+ CommandParameter pname("name", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pname);
+ CommandParameter pprocessors("processors", "Number", "", "1", "", "", "",false,false); parameters.push_back(pprocessors);
+ CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir);
+ CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir);
+
+ 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, "SeqSummaryCommand", "setParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+string SeqSummaryCommand::getHelpString(){
+ try {
+ string helpString = "";
+ helpString += "The summary.seqs command reads a fastafile and summarizes the sequences.\n";
+ helpString += "The summary.seqs command parameters are fasta, name and processors, fasta is required, unless you have a valid current fasta file.\n";
+ helpString += "The name parameter allows you to enter a name file associated with your fasta file. \n";
+ helpString += "The summary.seqs command should be in the following format: \n";
+ helpString += "summary.seqs(fasta=yourFastaFile, processors=2) \n";
+ helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n";
+ return helpString;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SeqSummaryCommand", "getHelpString");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+string SeqSummaryCommand::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 == "summary") { outputFileName = "summary"; }
+ 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, "SeqSummaryCommand", "getOutputFileNameTag");
+ exit(1);
+ }
+}
+
+//**********************************************************************************************************************
+SeqSummaryCommand::SeqSummaryCommand(){
+ try {
+ abort = true; calledHelp = true;
+ setParameters();
+ vector<string> tempOutNames;
+ outputTypes["summary"] = tempOutNames;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SeqSummaryCommand", "SeqSummaryCommand");
+ exit(1);
+ }
+}