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["read.shared"] = "read.shared";
21 commands["cluster"] = "cluster";
22 commands["deconvolute"] = "deconvolute";
23 commands["parsimony"] = "parsimony";
24 commands["help"] = "help";
25 commands["quit"] = "quit";
26 commands["collect.single"] = "collect.single";
27 commands["collect.shared"] = "collect.shared";
28 commands["get.group"] = "get.group";
29 commands["get.label"] = "get.label";
30 commands["get.line"] = "get.line";
31 commands["rarefaction.single"] = "rarefaction.single";
32 commands["rarefaction.shared"] = "rarefaction.shared";
33 commands["summary.single"] = "summary.single";
34 commands["summary.shared"] = "summary.shared";
35 commands["unifrac.weighted"] = "unifrac.weighted";
36 commands["unifrac.unweighted"] = "unifrac.unweighted";
41 cout << "Standard Error: " << e.what() << " has occurred in the ValidCommands class Function ValidCommands. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
45 cout << "An unknown error has occurred in the ValidCommands class function ValidCommands. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
50 /***********************************************************************/
52 ValidCommands::~ValidCommands() {}
54 /***********************************************************************/
55 bool ValidCommands::isValidCommand(string command) {
58 //is the command in the map
59 if ((commands.find(command)) != (commands.end())) {
62 cout << command << " is not a valid command in Mothur. Valid commands are ";
63 for (it = commands.begin(); it != commands.end(); it++) {
64 cout << it->first << ", ";
72 cout << "Standard Error: " << e.what() << " has occurred in the ValidCommands class Function isValidCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
76 cout << "An unknown error has occurred in the ValidCommands class function isValidCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
81 /***********************************************************************/
82 void ValidCommands::printCommands(ostream& out) {
84 out << "Valid commands are ";
85 for (it = commands.begin(); it != commands.end(); it++) {
86 out << it->first << ", ";
91 cout << "Standard Error: " << e.what() << " has occurred in the ValidCommands class Function printCommands. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
95 cout << "An unknown error has occurred in the ValidCommands class function printCommands. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";