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