5 * Created by Sarah Westcott on 1/5/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "validcommands.h"
12 /***********************************************************************/
14 ValidCommands::ValidCommands() {
17 commands["read.dist"] = "read.dist";
18 commands["read.otu"] = "read.otu";
19 commands["read.tree"] = "read.tree";
20 commands["bin.seqs"] = "bin.seqs";
21 commands["get.oturep"] = "get.oturep";
22 commands["cluster"] = "cluster";
23 commands["deconvolute"] = "deconvolute";
24 commands["collect.single"] = "collect.single";
25 commands["collect.shared"] = "collect.shared";
26 commands["rarefaction.single"] = "rarefaction.single";
27 commands["rarefaction.shared"] = "rarefaction.shared";
28 commands["summary.single"] = "summary.single";
29 commands["summary.shared"] = "summary.shared";
30 commands["parsimony"] = "parsimony";
31 commands["unifrac.weighted"] = "unifrac.weighted";
32 commands["unifrac.unweighted"] = "unifrac.unweighted";
33 commands["libshuff"] = "libshuff";
34 commands["tree.shared"] = "tree.shared";
35 commands["heatmap"] = "heatmap";
36 commands["venn"] = "venn";
37 commands["get.group"] = "get.group";
38 commands["get.label"] = "get.label";
39 commands["get.line"] = "get.line";
40 commands["bootstrap.shared"] = "bootstrap.shared";
41 commands["help"] = "help";
42 commands["quit"] = "quit";
47 cout << "Standard Error: " << e.what() << " has occurred in the ValidCommands class Function ValidCommands. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
51 cout << "An unknown error has occurred in the ValidCommands class function ValidCommands. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
56 /***********************************************************************/
58 ValidCommands::~ValidCommands() {}
60 /***********************************************************************/
61 bool ValidCommands::isValidCommand(string command) {
64 //is the command in the map
65 if ((commands.find(command)) != (commands.end())) {
68 cout << command << " is not a valid command in Mothur. Valid commands are ";
69 for (it = commands.begin(); it != commands.end(); it++) {
70 cout << it->first << ", ";
78 cout << "Standard Error: " << e.what() << " has occurred in the ValidCommands class Function isValidCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
82 cout << "An unknown error has occurred in the ValidCommands class function isValidCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
87 /***********************************************************************/
88 void ValidCommands::printCommands(ostream& out) {
90 out << "Valid commands are ";
91 for (it = commands.begin(); it != commands.end(); it++) {
92 out << it->first << ", ";
97 cout << "Standard Error: " << e.what() << " has occurred in the ValidCommands class Function printCommands. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
101 cout << "An unknown error has occurred in the ValidCommands class function printCommands. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";