+//**********************************************************************************************************************
+vector<string> SffInfoCommand::setParameters(){
+ try {
+ CommandParameter psff("sff", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(psff);
+ CommandParameter paccnos("accnos", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(paccnos);
+ CommandParameter psfftxt("sfftxt", "String", "", "", "", "", "",false,false); parameters.push_back(psfftxt);
+ CommandParameter pflow("flow", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(pflow);
+ CommandParameter ptrim("trim", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(ptrim);
+ CommandParameter pfasta("fasta", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(pfasta);
+ CommandParameter pqfile("name", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(pqfile);
+ 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, "SffInfoCommand", "setParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+string SffInfoCommand::getHelpString(){
+ try {
+ string helpString = "";
+ helpString += "The sffinfo command reads a sff file and extracts the sequence data, or you can use it to parse a sfftxt file.\n";
+ helpString += "The sffinfo command parameters are sff, fasta, qfile, accnos, flow, sfftxt, and trim. sff is required. \n";
+ helpString += "The sff parameter allows you to enter the sff file you would like to extract data from. You may enter multiple files by separating them by -'s.\n";
+ helpString += "The fasta parameter allows you to indicate if you would like a fasta formatted file generated. Default=True. \n";
+ helpString += "The qfile parameter allows you to indicate if you would like a quality file generated. Default=True. \n";
+ helpString += "The flow parameter allows you to indicate if you would like a flowgram file generated. Default=True. \n";
+ helpString += "The sfftxt parameter allows you to indicate if you would like a sff.txt file generated. Default=False. \n";
+ helpString += "If you want to parse an existing sfftxt file into flow, fasta and quality file, enter the file name using the sfftxt parameter. \n";
+ helpString += "The trim parameter allows you to indicate if you would like a sequences and quality scores trimmed to the clipQualLeft and clipQualRight values. Default=True. \n";
+ helpString += "The accnos parameter allows you to provide a accnos file containing the names of the sequences you would like extracted. You may enter multiple files by separating them by -'s. \n";
+ helpString += "Example sffinfo(sff=mySffFile.sff, trim=F).\n";
+ helpString += "Note: No spaces between parameter labels (i.e. sff), '=' and parameters (i.e.yourSffFileName).\n";
+ return helpString;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SffInfoCommand", "getHelpString");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+string SffInfoCommand::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 = "fasta"; }
+ else if (type == "flow") { outputFileName = "flow"; }
+ else if (type == "sfftxt") { outputFileName = "sff.txt"; }
+ else if (type == "qfile") { outputFileName = "qual"; }
+ 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, "SffInfoCommand", "getOutputFileNameTag");
+ exit(1);
+ }
+}
+
+
+//**********************************************************************************************************************
+SffInfoCommand::SffInfoCommand(){
+ try {
+ abort = true; calledHelp = true;
+ setParameters();
+ vector<string> tempOutNames;
+ outputTypes["fasta"] = tempOutNames;
+ outputTypes["flow"] = tempOutNames;
+ outputTypes["sfftxt"] = tempOutNames;
+ outputTypes["qfile"] = tempOutNames;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SffInfoCommand", "SffInfoCommand");
+ exit(1);
+ }
+}