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.seqs"] = "read.seqs";
21 commands["bin.seqs"] = "bin.seqs";
22 commands["get.oturep"] = "get.oturep";
23 commands["cluster"] = "cluster";
24 commands["deconvolute"] = "deconvolute";
25 commands["dist.seqs"] = "dist.seqs";
26 commands["dist.shared"] = "dist.shared"; //matrix output
27 commands["collect.single"] = "collect.single";
28 commands["collect.shared"] = "collect.shared";
29 commands["rarefaction.single"] = "rarefaction.single";
30 commands["rarefaction.shared"] = "rarefaction.shared";
31 commands["summary.single"] = "summary.single";
32 commands["summary.shared"] = "summary.shared";
33 commands["parsimony"] = "parsimony";
34 commands["unifrac.weighted"] = "unifrac.weighted";
35 commands["unifrac.unweighted"] = "unifrac.unweighted";
36 commands["libshuff"] = "libshuff";
37 commands["tree.shared"] = "tree.shared";
38 commands["heatmap"] = "heatmap";
39 commands["venn"] = "venn";
40 commands["get.group"] = "get.group";
41 commands["get.label"] = "get.label";
42 commands["get.line"] = "get.line";
43 commands["bootstrap.shared"] = "bootstrap.shared";
44 commands["concensus"] = "concensus";
45 commands["help"] = "help";
46 commands["filter.seqs"] = "filter.seqs";
47 commands["align.seqs"] = "align.seqs";
48 commands["quit"] = "quit";
53 cout << "Standard Error: " << e.what() << " has occurred in the ValidCommands class Function ValidCommands. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
57 cout << "An unknown error has occurred in the ValidCommands class function ValidCommands. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
62 /***********************************************************************/
64 ValidCommands::~ValidCommands() {}
66 /***********************************************************************/
67 bool ValidCommands::isValidCommand(string command) {
70 //is the command in the map
71 if ((commands.find(command)) != (commands.end())) {
74 cout << command << " is not a valid command in Mothur. Valid commands are ";
75 for (it = commands.begin(); it != commands.end(); it++) {
76 cout << it->first << ", ";
84 cout << "Standard Error: " << e.what() << " has occurred in the ValidCommands class Function isValidCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
88 cout << "An unknown error has occurred in the ValidCommands class function isValidCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
93 /***********************************************************************/
94 void ValidCommands::printCommands(ostream& out) {
96 out << "Valid commands are ";
97 for (it = commands.begin(); it != commands.end(); it++) {
98 out << it->first << ", ";
102 catch(exception& e) {
103 cout << "Standard Error: " << e.what() << " has occurred in the ValidCommands class Function printCommands. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
107 cout << "An unknown error has occurred in the ValidCommands class function printCommands. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";