]> git.donarmstrong.com Git - mothur.git/blob - helpcommand.cpp
updated help
[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.dist") {
27                 cout << "The read.dist command parameter options are phylip or column, name, cutoff and precision" << "\n";
28                 cout << "The read.dist command should be in the following format: " << "\n";
29                 cout << "read.dist(phylip=yourDistFile, name=yourNameFile, cutoff=yourCutoff, precision=yourPrecision) " << "\n";
30                 cout << "The phylip or column parameter is required, but only one may be used.  If you use a column file the name filename is required. " << "\n";
31                 cout << "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";
32                 cout << "Note: No spaces between parameter labels (i.e. dist), '=' and parameters (i.e.yourDistfile)." << "\n" << "\n";
33         }else if (globaldata->helpRequest == "read.otu") {
34                 cout << "The read.otu command must be run before you execute a collect.single, rarefaction.single, summary.single, " << "\n";
35                 cout << "collect.shared, rarefaction.shared or summary.shared command.   Mothur will generate a .list, .rabund and .sabund upon completion of the cluster command " << "\n";
36                 cout << "or you may use your own. The read.otu command parameter options are list, rabund, sabund, group and order." << "\n";
37                 cout << "The read.otu command can be used in two ways.  The first is to read a list, rabund or sabund and run the collect.single, rarefaction.single or summary.single." << "\n";
38                 cout << "For this use the read.otu command should be in the following format: read.otu(list=yourListFile, order=yourOrderFile)." << "\n";
39                 cout << "The list, rabund or sabund parameter is required, but you may only use one of them." << "\n";
40                 cout << "The second way to use the read.otu command is to read a list and a group so you can use the collect.shared, rarefaction.shared or summary.shared commands." << "\n";
41                 cout << "In this case the read.otu command should be in the following format: read.otu(list=yourListFile, group=yourGroupFile).  " << "\n";
42                 cout << "The list parameter and group paramaters are required. When using the command the second way read.otu command parses the .list file" << "\n";
43                 cout << "and separates it into groups.  It outputs a .shared file containing the OTU information for each group. The read.otu command also outputs a .list file for each group. " << "\n";
44                 cout << "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
45         }else if (globaldata->helpRequest == "cluster") {
46                 cout << "The cluster command can only be executed after a successful read.dist command." << "\n";
47                 cout << "The cluster command parameter options are method, cuttoff and precision. No parameters are required." << "\n";
48                 cout << "The cluster command should be in the following format: " << "\n";
49                 cout << "cluster(method=yourMethod, cutoff=yourCutoff, precision=yourPrecision) " << "\n";
50                 cout << "The acceptable cluster methods are furthest, nearest and average.  If no method is provided then furthest is assumed." << "\n" << "\n";
51         }else if (globaldata->helpRequest == "deconvolute") {
52                 cout << "The deconvolute command reads a fastafile and creates a namesfile." << "\n";
53                 cout << "It creates a file where the first column is the groupname and the second column is a list of sequence names who have the same sequence. " << "\n";
54                 cout << "If the sequence is unique the second column will just contain its name. " << "\n";
55                 cout << "The deconvolute command parameter is fasta and it is required." << "\n";
56                 cout << "The deconvolute command should be in the following format: " << "\n";
57                 cout << "deconvolute(fasta=yourFastaFile) " << "\n";
58         }else if (globaldata->helpRequest == "collect.single") {
59                 cout << "The collect.single command can only be executed after a successful read.otu command. WITH ONE EXECEPTION. " << "\n";
60                 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";
61                 cout << "The collect.single command parameters are label, line, freq, single.  No parameters are required, but you may not use " << "\n";
62                 cout << "both the line and label parameters at the same time. The collect.single command should be in the following format: " << "\n";
63                 cout << "collect.single(label=yourLabel, line=yourLines, iters=yourIters, freq=yourFreq, single=yourEstimators)." << "\n";
64                 cout << "Example collect(label=unique-.01-.03, line=0,5,10, iters=10000, freq=10, single=collect-chao-ace-jack)." << "\n";
65                 cout << "The default values for freq is 100, and single are sobs-chao-ace-jack-bootstrap-shannon-npshannon-simpson." << "\n";
66                 cout << "The label and line parameters are used to analyze specific lines in your input." << "\n";
67                 cout << "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
68         }else if (globaldata->helpRequest == "collect.shared") {
69                 cout << "The collect.shared command can only be executed after a successful read.otu command." << "\n";
70                 cout << "The collect.shared command parameters are label, line, freq, jumble, shared.  No parameters are required, but you may not use " << "\n";
71                 cout << "both the line and label parameters at the same time. The collect.shared command should be in the following format: " << "\n";
72                 cout << "collect.shared(label=yourLabel, line=yourLines, freq=yourFreq, jumble=yourJumble, shared=yourEstimators)." << "\n";
73                 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";
74                 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";
75                 cout << "The label and line parameters are used to analyze specific lines in your input." << "\n";
76                 cout << "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
77         }else if (globaldata->helpRequest == "rarefaction.single") {
78                 cout << "The rarefaction.single command can only be executed after a successful read.otu WTIH ONE EXECEPTION." << "\n";
79                 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";
80                 cout << "The rarefaction.single command parameters are label, line, iters, freq, rarefaction.  No parameters are required, but you may not use " << "\n";
81                 cout << "both the line and label parameters at the same time. The rarefaction.single command should be in the following format: " << "\n";
82                 cout << "rarefaction.single(label=yourLabel, line=yourLines, iters=yourIters, freq=yourFreq, rarefaction=yourEstimators)." << "\n";
83                 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";
84                 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";
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. list), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
87         }else if (globaldata->helpRequest == "rarefaction.shared") {
88                 cout << "The rarefaction.shared command can only be executed after a successful read.otu command." << "\n";
89                 cout << "The rarefaction.shared command parameters are label, line, iters, jumble and sharedrarefaction.  No parameters are required, but you may not use " << "\n";
90                 cout << "both the line and label parameters at the same time. The rarefaction command should be in the following format: " << "\n";
91                 cout << "rarefaction.shared(label=yourLabel, line=yourLines, iters=yourIters, jumble=yourJumble, sharedrarefaction=yourEstimators)." << "\n";
92                 cout << "Example rarefaction.shared(label=unique-.01-.03, line=0,5,10, iters=10000, jumble=1, sharedrarefaction=sharedobserved)." << "\n";
93                 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";
94                 cout << "The label and line parameters are used to analyze specific lines in your input." << "\n";
95                 cout << "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
96         }else if (globaldata->helpRequest == "summary.single") { 
97                 cout << "The summary.single command can only be executed after a successful read.otu WTIH ONE EXECEPTION." << "\n";
98                 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";
99                 cout << "The summary.single command parameters are label, line, summary.  No parameters are required, but you may not use " << "\n";
100                 cout << "both the line and label parameters at the same time. The summary.single command should be in the following format: " << "\n";
101                 cout << "summary.single(label=yourLabel, line=yourLines, summary=yourEstimators)." << "\n";
102                 cout << "Example summary.single(label=unique-.01-.03, line=0,5,10, summary=sobs-chao-ace-jack-bootstrap-shannon-npshannon-simpson)." << "\n";
103                 cout << "The default value summary is sobs-chao-ace-jack-bootstrap-shannon-npshannon-simpson" << "\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. list), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
106         }else if (globaldata->helpRequest == "summary.shared") { 
107                 cout << "The summary.shared command can only be executed after a successful read.otu command." << "\n";
108                 cout << "The summary.shared command parameters are label, line, jumble and sharedsummary.  No parameters are required, but you may not use " << "\n";
109                 cout << "both the line and label parameters at the same time. The summary.shared command should be in the following format: " << "\n";
110                 cout << "summary.shared(label=yourLabel, line=yourLines, jumble=yourJumble, sharedsummary=yourEstimators)." << "\n";
111                 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";
112                 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";
113                 cout << "The label and line parameters are used to analyze specific lines in your input." << "\n";
114                 cout << "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile)." << "\n" << "\n";
115         }else if (globaldata->helpRequest == "quit") {
116                 cout << "The quit command will terminate Dotur and should be in the following format: " << "\n";
117                 cout << "quit()" << "\n" << "\n";
118         }else if (globaldata->helpRequest == "") {
119                 cout << "Valid commands are read.dist(), read.otu(), cluster(), deconvolute(), collect.single(), rarefaction.single(), summary.single(), collect.shared(), rarefaction.shared(), summary.shared(), quit(), help()." << "\n";
120                 cout << "For more information about a specific command type 'help(commandName)' i.e. 'help(read.dist)'" << endl;
121         }else {
122                 cout << globaldata->helpRequest << " is not a valid command" << endl;
123         }
124         
125         cout << endl << "For further assistance please refer to the Mothur manual, or contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
126         return 0;
127 }
128
129 //**********************************************************************************************************************/