+//**********************************************************************************************************************
+vector<string> RareFactSharedCommand::setParameters(){
+ try {
+ CommandParameter pshared("shared", "InputTypes", "", "", "none", "none", "none",false,true); parameters.push_back(pshared);
+ CommandParameter plabel("label", "String", "", "", "", "", "",false,false); parameters.push_back(plabel);
+ CommandParameter pfreq("freq", "Number", "", "100", "", "", "",false,false); parameters.push_back(pfreq);
+ CommandParameter piters("iters", "Number", "", "1000", "", "", "",false,false); parameters.push_back(piters);
+ CommandParameter pcalc("calc", "Multiple", "sharednseqs-sharedobserved", "sharedobserved", "", "", "",true,false); parameters.push_back(pcalc);
+ CommandParameter pjumble("jumble", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(pjumble);
+ CommandParameter pgroups("groups", "String", "", "", "", "", "",false,false); parameters.push_back(pgroups);
+ 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, "RareFactSharedCommand", "setParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+string RareFactSharedCommand::getHelpString(){
+ try {
+ string helpString = "";
+ ValidCalculators validCalculator;
+ helpString += "The collect.shared command parameters are shared, label, freq, calc and groups. shared is required if there is no current sharedfile. \n";
+ helpString += "The rarefaction.shared command parameters are shared, label, iters, groups, jumble and calc. shared is required if there is no current sharedfile. \n";
+ helpString += "The rarefaction command should be in the following format: \n";
+ helpString += "rarefaction.shared(label=yourLabel, iters=yourIters, calc=yourEstimators, jumble=yourJumble, groups=yourGroups).\n";
+ helpString += "The freq parameter is used indicate when to output your data, by default it is set to 100. But you can set it to a percentage of the number of sequence. For example freq=0.10, means 10%. \n";
+ helpString += "Example rarefaction.shared(label=unique-0.01-0.03, iters=10000, groups=B-C, jumble=T, calc=sharedobserved).\n";
+ helpString += "The default values for iters is 1000, freq is 100, and calc is sharedobserved which calculates the shared rarefaction curve for the observed richness.\n";
+ helpString += "The default value for groups is all the groups in your groupfile, and jumble is true.\n";
+ helpString += validCalculator.printCalc("sharedrarefaction");
+ helpString += "The label parameter is used to analyze specific labels in your input.\n";
+ helpString += "The groups parameter allows you to specify which of the groups in your groupfile you would like analyzed. You must enter at least 2 valid groups.\n";
+ helpString += "Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq).\n";
+ return helpString;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "RareFactSharedCommand", "getHelpString");
+ exit(1);
+ }
+}
+
+//**********************************************************************************************************************
+RareFactSharedCommand::RareFactSharedCommand(){
+ try {
+ abort = true; calledHelp = true;
+ setParameters();
+ vector<string> tempOutNames;
+ outputTypes["sharedrarefaction"] = tempOutNames;
+ outputTypes["sharedr_nseqs"] = tempOutNames;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "RareFactSharedCommand", "RareFactSharedCommand");
+ exit(1);
+ }
+}