]> git.donarmstrong.com Git - mothur.git/blob - validparameter.cpp
fixed summary.shared bug and set jumble default to 1.
[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["phylipfile"]                = "phylipfile";
18                 parameters["columnfile"]                = "columnfile";
19                 parameters["listfile"]                  = "listfile"; 
20                 parameters["rabundfile"]                = "rabundfile"; 
21                 parameters["sabundfile"]                = "sabundfile"; 
22                 parameters["namefile"]                  = "namefile"; 
23                 parameters["groupfile"]                 = "groupfile"; 
24                 parameters["orderfile"]                 = "orderfile"; 
25                 parameters["fastafile"]                 = "fastafile"; 
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
44         }
45         catch(exception& e) {
46                 cout << "Standard Error: " << e.what() << " has occurred in the ValidParameters class Function ValidParameters. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
47                 exit(1);
48         }
49         catch(...) {
50                 cout << "An unknown error has occurred in the ValidParameters class function ValidParameters. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
51                 exit(1);
52         }       
53 }
54
55 /***********************************************************************/
56
57 ValidParameters::~ValidParameters() {}
58
59 /***********************************************************************/
60 bool ValidParameters::isValidParameter(string parameter) {
61         try {   
62         
63                 //is the parameter in the map
64                 if ((parameters.find(parameter)) != (parameters.end())) {
65                         return true;
66                 }else{
67                         cout << parameter << " is not a valid parameter in Mothur." << endl;
68                         return false;
69                 }
70                 
71         }
72         catch(exception& e) {
73                 cout << "Standard Error: " << e.what() << " has occurred in the ValidParameters class Function isValidParameter. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
74                 exit(1);
75         }
76         catch(...) {
77                 cout << "An unknown error has occurred in the ValidParameters class function isValidParameter. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
78                 exit(1);
79         }
80 }
81
82 /***********************************************************************/