]> git.donarmstrong.com Git - mothur.git/blob - helpcommand.cpp
Initial revision
[mothur.git] / helpcommand.cpp
1 /*
2  *  helpcommand.cpp
3  *  Dotur
4  *
5  *  Created by Sarah Westcott on 1/2/09.
6  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
7  *
8  */
9
10 #include "helpcommand.h"
11
12 //**********************************************************************************************************************
13
14 HelpCommand::HelpCommand(){}
15
16 //**********************************************************************************************************************
17
18 HelpCommand::~HelpCommand(){}
19
20 //**********************************************************************************************************************
21
22 int HelpCommand::execute(){
23
24         globaldata = GlobalData::getInstance();
25         
26         if (globaldata->helpRequest == "read.phylip") {
27                 cout << "The read.phylip command parameter options are distfile, namefile, cutoff and precision" << "\n";
28                 cout << "The read.phylip command should be in the following format: " << "\n";
29                 cout << "read.phylip(distfile=yourDistFile, namefile=yourNameFile, cutoff=yourCutoff, precision=yourPrecision) " << "\n";
30                 cout << "The distfile parameter is required.  If you do not provide a cutoff value 10.00 is assumed. If you do not provide a precision value then 100 is assumed." << "\n";
31                 cout << "Note: No spaces between parameter labels (i.e. distfile), '=' and parameters (i.e.yourDistfile)." << "\n" << "\n";
32         }else if (globaldata->helpRequest == "read.column") {
33                 cout << "The read.column command parameter options are distfile, namefile, cutoff and precision" << "\n";
34                 cout << "The read.column command should be in the following format: " << "\n";
35                 cout << "read.column(distfile=yourDistFile, namefile=yourNameFile, cutoff=yourCutoff, precision=yourPrecision) " << "\n";
36                 cout << "The distfile and namefile parameters are required.  If you do not provide a cutoff value 10.00 is assumed. If you do not provide a precision value then 100 is assumed." << "\n";
37                 cout << "Note: No spaces between parameter labels (i.e. distfile), '=' and parameters (i.e.yourDistfile)." << "\n" << "\n";
38         }else if (globaldata->helpRequest == "read.list") {
39                 cout << "The read.list command parameter options are listfile and orderfile." << "\n";
40                 cout << "The read.list command should be in the following format: " << "\n";
41                 cout << "read.list(listfile=yourListFile, orderfile=yourOrderFile) " << "\n";
42                 cout << "The listfile parameter is required." << "\n";
43                 cout << "Note: No spaces between parameter labels (i.e. listfile), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
44         }else if (globaldata->helpRequest == "read.rabund") {
45                 cout << "The read.rabund command parameter options are rabundfile and orderfile." << "\n";
46                 cout << "The read.rabund command should be in the following format: " << "\n";
47                 cout << "read.rabund(rabundfile=yourRAbundFile, orderfile=yourOrderFile) " << "\n";
48                 cout << "The rabundfile parameter is required." << "\n";
49                 cout << "Note: No spaces between parameter labels (i.e. rabundfile), '=' and parameters (i.e.yourRAbundfile)." << "\n" << "\n";
50         }else if (globaldata->helpRequest == "read.sabund") {
51                 cout << "The read.sabund command parameter options are sabundfile and orderfile." << "\n";
52                 cout << "The read.sabund command should be in the following format: " << "\n";
53                 cout << "read.sabund(sabundfile=yourSAbundFile, orderfile=yourOrderFile) " << "\n";
54                 cout << "The sabundfile parameter is required." << "\n";
55                 cout << "Note: No spaces between parameter labels (i.e. sabundfile), '=' and parameters (i.e.yourSAbundfile)." << "\n" << "\n";
56         }else if (globaldata->helpRequest == "read.shared") {
57                 cout << "The read.shared command parameter options are listfile and groupfile." << "\n";
58                 cout << "The read.shared command should be in the following format: " << "\n";
59                 cout << "read.shared(listfile=yourListFile, groupfile=yourGroupFile) " << "\n";
60                 cout << "The listfile parameter and groupfile paramaters are required." << "\n";
61                 cout << "Note: No spaces between parameter labels (i.e. listfile), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
62         }else if (globaldata->helpRequest == "cluster") {
63                 cout << "The cluster command can only be executed after a successful read.phylip or read.column command." << "\n";
64                 cout << "The cluster command parameter options are method, cuttoff and precision. No parameters are required." << "\n";
65                 cout << "The cluster command should be in the following format: " << "\n";
66                 cout << "cluster(method=yourMethod, cutoff=yourCutoff, precision=yourPrecision) " << "\n";
67                 cout << "The acceptable cluster methods are furthest, nearest and average.  If no method is provided then furthest is assumed." << "\n" << "\n";
68         }else if (globaldata->helpRequest == "collect.single") {
69                 cout << "The collect.single command can only be executed after a successful read.list read.rabund or rad.sabund command. WITH ONE EXECEPTION. " << "\n";
70                 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";
71                 cout << "The collect.single command parameters are label, line, freq, single.  No parameters are required, but you may not use " << "\n";
72                 cout << "both the line and label parameters at the same time. The collect.single command should be in the following format: " << "\n";
73                 cout << "collect.single(label=yourLabel, line=yourLines, iters=yourIters, freq=yourFreq, single=yourEstimators)." << "\n";
74                 cout << "Example collect(label=unique-.01-.03, line=0,5,10, iters=10000, freq=10, single=collect-chao-ace-jack)." << "\n";
75                 cout << "The default values for freq is 100, and single are sobs-chao-ace-jack-bootstrap-shannon-npshannon-simpson." << "\n";
76                 cout << "The label and line parameters are used to analyze specific lines in your input." << "\n";
77                 cout << "Note: No spaces between parameter labels (i.e. listfile), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
78         }else if (globaldata->helpRequest == "collect.shared") {
79                 cout << "The collect.shared command can only be executed after a successful read.shared command." << "\n";
80                 cout << "The collect.shared command parameters are label, line, freq, jumble, shared.  No parameters are required, but you may not use " << "\n";
81                 cout << "both the line and label parameters at the same time. The collect.shared command should be in the following format: " << "\n";
82                 cout << "collect.shared(label=yourLabel, line=yourLines, freq=yourFreq, jumble=yourJumble, shared=yourEstimators)." << "\n";
83                 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";
84                 cout << "The default values for jumble is 0 (meaning don’t jumble, if it’s set to 1 then it will jumble), freq is 100 and shared are sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN." << "\n";
85                 cout << "The label and line parameters are used to analyze specific lines in your input." << "\n";
86                 cout << "Note: No spaces between parameter labels (i.e. listfile), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
87         }else if (globaldata->helpRequest == "rarefaction.single") {
88                 cout << "The rarefaction.single command can only be executed after a successful read.list, read.rabund or read.sabund. WTIH ONE EXECEPTION." << "\n";
89                 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";
90                 cout << "The rarefaction.single command parameters are label, line, iters, freq, rarefaction.  No parameters are required, but you may not use " << "\n";
91                 cout << "both the line and label parameters at the same time. The rarefaction.single command should be in the following format: " << "\n";
92                 cout << "rarefaction.single(label=yourLabel, line=yourLines, iters=yourIters, freq=yourFreq, rarefaction=yourEstimators)." << "\n";
93                 cout << "Example rarefaction.single(label=unique-.01-.03, line=0,5,10, iters=10000, freq=10, rarefaction=rarefaction-rchao-race-rjack-rbootstrap-rshannon-rnpshannon-rsimpson)." << "\n";
94                 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";
95                 cout << "The label and line parameters are used to analyze specific lines in your input." << "\n";
96                 cout << "Note: No spaces between parameter labels (i.e. listfile), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
97         }else if (globaldata->helpRequest == "rarefaction.shared") {
98                 cout << "The rarefaction.shared command can only be executed after a successful read.shared command." << "\n";
99                 cout << "The rarefaction.shared command parameters are label, line, iters, jumble and sharedrarefaction.  No parameters are required, but you may not use " << "\n";
100                 cout << "both the line and label parameters at the same time. The rarefaction command should be in the following format: " << "\n";
101                 cout << "rarefaction.shared(label=yourLabel, line=yourLines, iters=yourIters, jumble=yourJumble, sharedrarefaction=yourEstimators)." << "\n";
102                 cout << "Example rarefaction.shared(label=unique-.01-.03, line=0,5,10, iters=10000, jumble=1, sharedrarefaction=sharedobserved)." << "\n";
103                 cout << "The default values for iters is 1000, jumble is 0 (meaning don’t jumble, if it’s set to 1 then it will jumble), freq is 100, and sharedrarefaction is sharedobserved which calculates the shared rarefaction curve for the observed richness." << "\n";
104                 cout << "The label and line parameters are used to analyze specific lines in your input." << "\n";
105                 cout << "Note: No spaces between parameter labels (i.e. listfile), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
106         }else if (globaldata->helpRequest == "summary.single") { 
107                 cout << "The summary.single command can only be executed after a successful read.list, read.rabund or read.sabund. WTIH ONE EXECEPTION." << "\n";
108                 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";
109                 cout << "The summary.single command parameters are label, line, summary.  No parameters are required, but you may not use " << "\n";
110                 cout << "both the line and label parameters at the same time. The summary.single command should be in the following format: " << "\n";
111                 cout << "summary.single(label=yourLabel, line=yourLines, summary=yourEstimators)." << "\n";
112                 cout << "Example summary.single(label=unique-.01-.03, line=0,5,10, summary=sobs-chao-ace-jack-bootstrap-shannon-npshannon-simpson)." << "\n";
113                 cout << "The default value summary is sobs-chao-ace-jack-bootstrap-shannon-npshannon-simpson" << "\n";
114                 cout << "The label and line parameters are used to analyze specific lines in your input." << "\n";
115                 cout << "Note: No spaces between parameter labels (i.e. listfile), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
116         }else if (globaldata->helpRequest == "summary.shared") { 
117                 cout << "The summary.shared command can only be executed after a successful read.shared command." << "\n";
118                 cout << "The summary.shared command parameters are label, line, jumble and sharedsummary.  No parameters are required, but you may not use " << "\n";
119                 cout << "both the line and label parameters at the same time. The summary.shared command should be in the following format: " << "\n";
120                 cout << "summary.shared(label=yourLabel, line=yourLines, jumble=yourJumble, sharedsummary=yourEstimators)." << "\n";
121                 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";
122                 cout << "The default value for jumble is 0 (meaning don’t jumble, if it’s set to 1 then it will jumble) and sharedsummary is sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN" << "\n";
123                 cout << "The label and line parameters are used to analyze specific lines in your input." << "\n";
124                 cout << "Note: No spaces between parameter labels (i.e. listfile), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
125         }else if (globaldata->helpRequest == "shared") { 
126                 cout << "The shared command can only be executed after a successful read.shared command." << "\n";
127                 cout << "The shared command parses a list file and separates it into groups." << "\n";
128                 cout << "It outputs a shared file containing the otu information for each group.  There are no shared command parameters." << "\n";
129                 cout << "The shared command should be in the following format: shared()." << "\n";
130                 cout << "Example shared()." << "\n";
131         }else if (globaldata->helpRequest == "parselist") { 
132                 cout << "The parselist command parses a list file and separates it into groups." << "\n";
133                 cout << "It outputs a list file for each group." << "\n";
134                 cout << "The parselist command parameter options are listfile and groupfile." << "\n";
135                 cout << "The parselist command should be in the following format: " << "\n";
136                 cout << "parselist(listfile=yourListFile, groupfile=yourGroupFile) " << "\n";
137                 cout << "The listfile parameter and groupfile paramater are required." << "\n";
138                 cout << "Note: No spaces between parameter labels (i.e. listfile), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
139         }else if (globaldata->helpRequest == "quit") {
140                 cout << "The quit command will terminate Dotur and should be in the following format: " << "\n";
141                 cout << "quit()" << "\n" << "\n";
142         }else if (globaldata->helpRequest == "") {
143                 cout << "Valid commands are read.phylip(), read.column(), read.list(), read.rabund(), read.sabund(), cluster(), collect.single(), rarefaction.single(), summary.single(), collect.shared(), rarefaction.shared(), summary.shared(), shared(), pareselist(), quit(), help()." << "\n";
144                 cout << "For more information about a specific command type 'help(commandName)' i.e. 'help(read.phylip)'" << endl;
145         }else {
146                 cout << "not a valid command" << endl;
147         }
148         
149         cout << endl << "For further assistance please refer to the Mothur manual, or contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
150         return 0;
151 }
152
153 //**********************************************************************************************************************/