]> git.donarmstrong.com Git - mothur.git/blob - validparameter.cpp
adding treeclimber and unifrac pieces
[mothur.git] / validparameter.cpp
1 /*
2  *  validparameter.cpp
3  *  Dotur
4  *
5  *  Created by Sarah Westcott on 1/5/09.
6  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
7  *
8  */
9
10 #include "validparameter.h"
11
12 /***********************************************************************/
13
14 ValidParameters::ValidParameters() {
15         try {
16         
17                 parameters["phylip"]            = "phylip";
18                 parameters["column"]            = "column";
19                 parameters["list"]                      = "list"; 
20                 parameters["rabund"]            = "rabund"; 
21                 parameters["sabund"]            = "sabund"; 
22                 parameters["name"]                      = "name"; 
23                 parameters["group"]                     = "group"; 
24                 parameters["order"]                     = "order"; 
25                 parameters["fasta"]                     = "fasta"; 
26                 parameters["treefile"]                  = "treefile";
27                 parameters["fileroot"]                  = "fileroot";
28                 parameters["cutoff"]                    = "cutoff"; 
29                 parameters["method"]                    = "method";
30                 parameters["format"]                    = "format"; 
31                 parameters["precision"]                 = "precision"; 
32                 parameters["label"]                             = "label"; 
33                 parameters["line"]                              = "line"; 
34                 parameters["iters"]                             = "iters"; 
35                 parameters["jumble"]                    = "jumble"; 
36                 parameters["freq"]                              = "freq"; 
37                 parameters["single"]                    = "single"; 
38                 parameters["rarefaction"]               = "rarefaction"; 
39                 parameters["sharedrarefaction"] = "sharedrarefaction";
40                 parameters["shared"]                    = "shared"; 
41                 parameters["summary"]                   = "summary"; 
42                 parameters["sharedsummary"]             = "sharedsummary";
43                 parameters["randomtree"]                = "randomtree";
44                 parameters["groups"]                    = "groups";
45                 
46         }
47         catch(exception& e) {
48                 cout << "Standard Error: " << e.what() << " has occurred in the ValidParameters class Function ValidParameters. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
49                 exit(1);
50         }
51         catch(...) {
52                 cout << "An unknown error has occurred in the ValidParameters class function ValidParameters. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
53                 exit(1);
54         }       
55 }
56
57 /***********************************************************************/
58
59 ValidParameters::~ValidParameters() {}
60
61 /***********************************************************************/
62 bool ValidParameters::isValidParameter(string parameter) {
63         try {   
64         
65                 //is the parameter in the map
66                 if ((parameters.find(parameter)) != (parameters.end())) {
67                         return true;
68                 }else{
69                         cout << parameter << " is not a valid parameter in Mothur." << endl;
70                         return false;
71                 }
72                 
73         }
74         catch(exception& e) {
75                 cout << "Standard Error: " << e.what() << " has occurred in the ValidParameters class Function isValidParameter. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
76                 exit(1);
77         }
78         catch(...) {
79                 cout << "An unknown error has occurred in the ValidParameters class function isValidParameter. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
80                 exit(1);
81         }
82 }
83
84 /***********************************************************************/