//**********************************************************************************************************************
-HelpCommand::HelpCommand(){}
+HelpCommand::HelpCommand(){
+ globaldata = GlobalData::getInstance();
+ validCommands = new ValidCommands();
+}
//**********************************************************************************************************************
int HelpCommand::execute(){
- globaldata = GlobalData::getInstance();
-
if (globaldata->helpRequest == "read.dist") {
cout << "The read.dist command parameter options are phylip or column, name, cutoff and precision" << "\n";
cout << "The read.dist command should be in the following format: " << "\n";
cout << "It also must be run before using the parsimony command, unless you are using the randomtree parameter." << "\n";
cout << "The read.tree command should be in the following format: read.tree(tree=yourTreeFile, group=yourGroupFile)." << "\n";
cout << "The tree and group parameters are both required." << "\n";
- cout << "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
+ cout << "Note: No spaces between parameter labels (i.e. tree), '=' and parameters (i.e.yourTreefile)." << "\n" << "\n";
+ }else if (globaldata->helpRequest == "read.shared") {
+ cout << "The read.shared must be run before you execute a collect.shared, rarefaction.shared or summary.shared command." << "\n";
+ cout << "The read.shared command is used to read a shared file. The read.shared should be entered in the following format:" << "\n";
+ cout << "read.shared(shared=yourSharedFile). The shared parameter is required." << "\n";
+ cout << "Note: No spaces between parameter labels (i.e. shared), '=' and parameters (i.e.yourSharedfile)." << "\n" << "\n";
}else if (globaldata->helpRequest == "cluster") {
cout << "The cluster command can only be executed after a successful read.dist command." << "\n";
cout << "The cluster command parameter options are method, cuttoff and precision. No parameters are required." << "\n";
}else if (globaldata->helpRequest == "collect.single") {
cout << "The collect.single command can only be executed after a successful read.otu command. WITH ONE EXECEPTION. " << "\n";
cout << "The collect.single command can be executed after a successful cluster command. It will use the .list file from the output of the cluster." << "\n";
- cout << "The collect.single command parameters are label, line, freq, single. No parameters are required, but you may not use " << "\n";
+ cout << "The collect.single command parameters are label, line, freq, calc. No parameters are required, but you may not use " << "\n";
cout << "both the line and label parameters at the same time. The collect.single command should be in the following format: " << "\n";
- cout << "collect.single(label=yourLabel, line=yourLines, iters=yourIters, freq=yourFreq, single=yourEstimators)." << "\n";
- cout << "Example collect(label=unique-.01-.03, line=0,5,10, iters=10000, freq=10, single=collect-chao-ace-jack)." << "\n";
- cout << "The default values for freq is 100, and single are sobs-chao-ace-jack-bootstrap-shannon-npshannon-simpson." << "\n";
+ cout << "collect.single(label=yourLabel, line=yourLines, iters=yourIters, freq=yourFreq, calc=yourEstimators)." << "\n";
+ cout << "Example collect(label=unique-.01-.03, line=0,5,10, iters=10000, freq=10, calc=sobs-chao-ace-jack)." << "\n";
+ cout << "The default values for freq is 100, and calc are sobs-chao-ace-jack-bootstrap-shannon-npshannon-simpson." << "\n";
cout << "The label and line parameters are used to analyze specific lines in your input." << "\n";
- cout << "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
+ cout << "Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq)." << "\n" << "\n";
}else if (globaldata->helpRequest == "collect.shared") {
cout << "The collect.shared command can only be executed after a successful read.otu command." << "\n";
- cout << "The collect.shared command parameters are label, line, freq, jumble, shared. No parameters are required, but you may not use " << "\n";
+ cout << "The collect.shared command parameters are label, line, freq, jumble, calc. No parameters are required, but you may not use " << "\n";
cout << "both the line and label parameters at the same time. The collect.shared command should be in the following format: " << "\n";
- cout << "collect.shared(label=yourLabel, line=yourLines, freq=yourFreq, jumble=yourJumble, shared=yourEstimators)." << "\n";
- cout << "Example collect.shared(label=unique-.01-.03, line=0,5,10, freq=10, jumble=1, shared=sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN)." << "\n";
- cout << "The default values for jumble is 1 (meaning jumble, if it’s set to 0 then it will not jumble), freq is 100 and shared are sharedsobs-sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN." << "\n";
+ cout << "collect.shared(label=yourLabel, line=yourLines, freq=yourFreq, jumble=yourJumble, calc=yourEstimators)." << "\n";
+ cout << "Example collect.shared(label=unique-.01-.03, line=0,5,10, freq=10, jumble=1, calc=sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN)." << "\n";
+ cout << "The default values for jumble is 1 (meaning jumble, if it’s set to 0 then it will not jumble), freq is 100 and calc are sharedsobs-sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN." << "\n";
cout << "The label and line parameters are used to analyze specific lines in your input." << "\n";
- cout << "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
+ cout << "Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq)." << "\n" << "\n";
}else if (globaldata->helpRequest == "rarefaction.single") {
cout << "The rarefaction.single command can only be executed after a successful read.otu WTIH ONE EXECEPTION." << "\n";
cout << "The rarefaction.single command can be executed after a successful cluster command. It will use the .list file from the output of the cluster." << "\n";
- cout << "The rarefaction.single command parameters are label, line, iters, freq, rarefaction. No parameters are required, but you may not use " << "\n";
+ cout << "The rarefaction.single command parameters are label, line, iters, freq, calc. No parameters are required, but you may not use " << "\n";
cout << "both the line and label parameters at the same time. The rarefaction.single command should be in the following format: " << "\n";
- cout << "rarefaction.single(label=yourLabel, line=yourLines, iters=yourIters, freq=yourFreq, rarefaction=yourEstimators)." << "\n";
- cout << "Example rarefaction.single(label=unique-.01-.03, line=0,5,10, iters=10000, freq=10, rarefaction=sobs-rchao-race-rjack-rbootstrap-rshannon-rnpshannon-rsimpson)." << "\n";
- cout << "The default values for iters is 1000, freq is 100, and rarefaction is rarefaction which calculates the rarefaction curve for the observed richness." << "\n";
+ cout << "rarefaction.single(label=yourLabel, line=yourLines, iters=yourIters, freq=yourFreq, calc=yourEstimators)." << "\n";
+ cout << "Example rarefaction.single(label=unique-.01-.03, line=0,5,10, iters=10000, freq=10, calc=sobs-rchao-race-rjack-rbootstrap-rshannon-rnpshannon-rsimpson)." << "\n";
+ cout << "The default values for iters is 1000, freq is 100, and calc is rarefaction which calculates the rarefaction curve for the observed richness." << "\n";
cout << "The label and line parameters are used to analyze specific lines in your input." << "\n";
- cout << "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
+ cout << "Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq)." << "\n" << "\n";
}else if (globaldata->helpRequest == "rarefaction.shared") {
cout << "The rarefaction.shared command can only be executed after a successful read.otu command." << "\n";
- cout << "The rarefaction.shared command parameters are label, line, iters, jumble and sharedrarefaction. No parameters are required, but you may not use " << "\n";
+ cout << "The rarefaction.shared command parameters are label, line, iters, jumble and calc. No parameters are required, but you may not use " << "\n";
cout << "both the line and label parameters at the same time. The rarefaction command should be in the following format: " << "\n";
- cout << "rarefaction.shared(label=yourLabel, line=yourLines, iters=yourIters, jumble=yourJumble, sharedrarefaction=yourEstimators)." << "\n";
- cout << "Example rarefaction.shared(label=unique-.01-.03, line=0,5,10, iters=10000, jumble=1, sharedrarefaction=sharedobserved)." << "\n";
- cout << "The default values for iters is 1000, jumble is 1 (meaning jumble, if it’s set to 0 then it will not jumble), freq is 100, and sharedrarefaction is sharedobserved which calculates the shared rarefaction curve for the observed richness." << "\n";
+ cout << "rarefaction.shared(label=yourLabel, line=yourLines, iters=yourIters, jumble=yourJumble, calc=yourEstimators)." << "\n";
+ cout << "Example rarefaction.shared(label=unique-.01-.03, line=0,5,10, iters=10000, jumble=1, calc=sharedobserved)." << "\n";
+ cout << "The default values for iters is 1000, jumble is 1 (meaning jumble, if it’s set to 0 then it will not jumble), freq is 100, and calc is sharedobserved which calculates the shared rarefaction curve for the observed richness." << "\n";
cout << "The label and line parameters are used to analyze specific lines in your input." << "\n";
- cout << "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
+ cout << "Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq)." << "\n" << "\n";
}else if (globaldata->helpRequest == "summary.single") {
cout << "The summary.single command can only be executed after a successful read.otu WTIH ONE EXECEPTION." << "\n";
cout << "The summary.single command can be executed after a successful cluster command. It will use the .list file from the output of the cluster." << "\n";
- cout << "The summary.single command parameters are label, line, summary. No parameters are required, but you may not use " << "\n";
+ cout << "The summary.single command parameters are label, line, calc. No parameters are required, but you may not use " << "\n";
cout << "both the line and label parameters at the same time. The summary.single command should be in the following format: " << "\n";
- cout << "summary.single(label=yourLabel, line=yourLines, summary=yourEstimators)." << "\n";
- cout << "Example summary.single(label=unique-.01-.03, line=0,5,10, summary=sobs-chao-ace-jack-bootstrap-shannon-npshannon-simpson)." << "\n";
- cout << "The default value summary is sobs-chao-ace-jack-bootstrap-shannon-npshannon-simpson" << "\n";
+ cout << "summary.single(label=yourLabel, line=yourLines, calc=yourEstimators)." << "\n";
+ cout << "Example summary.single(label=unique-.01-.03, line=0,5,10, calc=sobs-chao-ace-jack-bootstrap-shannon-npshannon-simpson)." << "\n";
+ cout << "The default value calc is sobs-chao-ace-jack-bootstrap-shannon-npshannon-simpson" << "\n";
cout << "The label and line parameters are used to analyze specific lines in your input." << "\n";
- cout << "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
+ cout << "Note: No spaces between parameter labels (i.e. line), '=' and parameters (i.e.yourLines)." << "\n" << "\n";
}else if (globaldata->helpRequest == "summary.shared") {
cout << "The summary.shared command can only be executed after a successful read.otu command." << "\n";
- cout << "The summary.shared command parameters are label, line, jumble and sharedsummary. No parameters are required, but you may not use " << "\n";
+ cout << "The summary.shared command parameters are label, line, jumble and calc. No parameters are required, but you may not use " << "\n";
cout << "both the line and label parameters at the same time. The summary.shared command should be in the following format: " << "\n";
- cout << "summary.shared(label=yourLabel, line=yourLines, jumble=yourJumble, sharedsummary=yourEstimators)." << "\n";
- cout << "Example summary.shared(label=unique-.01-.03, line=0,5,10, jumble=1, sharedsummary=sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN)." << "\n";
- cout << "The default value for jumble is 1 (meaning jumble, if it’s set to 0 then it will not jumble) and sharedsummary is sharedsobs-sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN" << "\n";
+ cout << "summary.shared(label=yourLabel, line=yourLines, jumble=yourJumble, calc=yourEstimators)." << "\n";
+ cout << "Example summary.shared(label=unique-.01-.03, line=0,5,10, jumble=1, calc=sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN)." << "\n";
+ cout << "The default value for jumble is 1 (meaning jumble, if it’s set to 0 then it will not jumble) and calc is sharedsobs-sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN" << "\n";
cout << "The label and line parameters are used to analyze specific lines in your input." << "\n";
- cout << "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
+ cout << "Note: No spaces between parameter labels (i.e. line), '=' and parameters (i.e.yourLines)." << "\n" << "\n";
}else if (globaldata->helpRequest == "parsimony") {
cout << "The parsimony command can only be executed after a successful read.tree command, unless you use the randomtree parameter." << "\n";
cout << "The parsimony command parameters are randomtree and iters. No parameters are required." << "\n";
cout << "The quit command will terminate Dotur and should be in the following format: " << "\n";
cout << "quit()" << "\n" << "\n";
}else if (globaldata->helpRequest == "") {
- cout << "Valid commands are read.dist(), read.otu(), read.tree(), cluster(), deconvolute(), collect.single(), rarefaction.single(), summary.single(), collect.shared(), rarefaction.shared(), summary.shared(), parsimony(), unifrac.weighted(), unifrac.unweighted(), quit(), help()." << "\n";
+ validCommands->printCommands(cout);
cout << "For more information about a specific command type 'help(commandName)' i.e. 'help(read.dist)'" << endl;
}else {
cout << globaldata->helpRequest << " is not a valid command" << endl;