- abort = false;
-
- //allow user to run help
- if(option == "help") { help(); abort = true; }
-
- else {
- //valid paramters for this command
- string Array[] = {"fasta", "filter", "correction", "processors", "method", "window", "increment", "template", "conservation", "quantile", "mask", "numwanted", "ksize", "svg", "name", "match","mismatch", "divergence", "minsim", "parents" };
- vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
-
- OptionParser parser(option);
- map<string,string> parameters = parser.getParameters();
-
- ValidParameters validParameter;
-
- //check to make sure all parameters are valid for command
- for (map<string,string>::iterator it = parameters.begin(); it != parameters.end(); it++) {
- if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; }
- }
-
- //check for required parameters
- fastafile = validParameter.validFile(parameters, "fasta", true);
- if (fastafile == "not open") { abort = true; }
- else if (fastafile == "not found") { fastafile = ""; mothurOut("fasta is a required parameter for the chimera.seqs command."); mothurOutEndLine(); abort = true; }
-
- templatefile = validParameter.validFile(parameters, "template", true);
- if (templatefile == "not open") { abort = true; }
- else if (templatefile == "not found") { templatefile = ""; }
-
- consfile = validParameter.validFile(parameters, "conservation", true);
- if (consfile == "not open") { abort = true; }
- else if (consfile == "not found") { consfile = ""; }
-
- quanfile = validParameter.validFile(parameters, "quantile", true);
- if (quanfile == "not open") { abort = true; }
- else if (quanfile == "not found") { quanfile = ""; }
-
- namefile = validParameter.validFile(parameters, "name", true);
- if (namefile == "not open") { abort = true; }
- else if (namefile == "not found") { namefile = ""; }
-
- maskfile = validParameter.validFile(parameters, "mask", false);
- if (maskfile == "not found") { maskfile = ""; }
- else if (maskfile != "default") {
- ifstream in;
- int ableToOpen = openInputFile(maskfile, in);
- if (ableToOpen == 1) { abort = true; }
- in.close();
- }
-
- method = validParameter.validFile(parameters, "method", false); if (method == "not found") { method = "pintail"; }
-
- string temp;
- temp = validParameter.validFile(parameters, "filter", false); if (temp == "not found") { temp = "F"; }
- filter = isTrue(temp);
-
- temp = validParameter.validFile(parameters, "correction", false); if (temp == "not found") { temp = "T"; }
- correction = isTrue(temp);
-
- temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found") { temp = "1"; }
- convert(temp, processors);
-
- temp = validParameter.validFile(parameters, "ksize", false); if (temp == "not found") { temp = "7"; }
- convert(temp, ksize);
-
- temp = validParameter.validFile(parameters, "svg", false); if (temp == "not found") { temp = "F"; }
- svg = isTrue(temp);
-
- temp = validParameter.validFile(parameters, "window", false);
- if ((temp == "not found") && (method == "chimeraslayer")) { temp = "100"; }
- else if (temp == "not found") { temp = "0"; }
- convert(temp, window);
-
- temp = validParameter.validFile(parameters, "match", false); if (temp == "not found") { temp = "5"; }
- convert(temp, match);
-
- temp = validParameter.validFile(parameters, "mismatch", false); if (temp == "not found") { temp = "-4"; }
- convert(temp, mismatch);
-
- temp = validParameter.validFile(parameters, "divergence", false); if (temp == "not found") { temp = "1.0"; }
- convert(temp, divR);
-
- temp = validParameter.validFile(parameters, "minsim", false); if (temp == "not found") { temp = "90"; }
- convert(temp, minSimilarity);
-
- temp = validParameter.validFile(parameters, "parents", false); if (temp == "not found") { temp = "5"; }
- convert(temp, parents);
-
- temp = validParameter.validFile(parameters, "increment", false);
- if ((temp == "not found") && ((method == "chimeracheck") || (method == "chimeraslayer"))) { temp = "10"; }
- else if (temp == "not found") { temp = "25"; }
- convert(temp, increment);
-
- temp = validParameter.validFile(parameters, "numwanted", false);
- if ((temp == "not found") && (method == "chimeraslayer")) { temp = "10"; }
- else if (temp == "not found") { temp = "20"; }
- convert(temp, numwanted);
-
-
-
- if (((method != "bellerophon")) && (templatefile == "")) { mothurOut("You must provide a template file with the pintail, ccode or chimeracheck methods."); mothurOutEndLine(); abort = true; }
-
-
- }