]> git.donarmstrong.com Git - mothur.git/blob - validparameter.cpp
deconvolute command
[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["fileroot"]                  = "fileroot";
27                 parameters["cutoff"]                    = "cutoff"; 
28                 parameters["method"]                    = "method";
29                 parameters["format"]                    = "format"; 
30                 parameters["precision"]                 = "precision"; 
31                 parameters["label"]                             = "label"; 
32                 parameters["line"]                              = "line"; 
33                 parameters["iters"]                             = "iters"; 
34                 parameters["jumble"]                    = "jumble"; 
35                 parameters["freq"]                              = "freq"; 
36                 parameters["single"]                    = "single"; 
37                 parameters["rarefaction"]               = "rarefaction"; 
38                 parameters["sharedrarefaction"] = "sharedrarefaction";
39                 parameters["shared"]                    = "shared"; 
40                 parameters["summary"]                   = "summary"; 
41                 parameters["sharedsummary"]             = "sharedsummary";
42
43         }
44         catch(exception& e) {
45                 cout << "Standard Error: " << e.what() << " has occurred in the ValidParameters class Function ValidParameters. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
46                 exit(1);
47         }
48         catch(...) {
49                 cout << "An unknown error has occurred in the ValidParameters class function ValidParameters. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
50                 exit(1);
51         }       
52 }
53
54 /***********************************************************************/
55
56 ValidParameters::~ValidParameters() {}
57
58 /***********************************************************************/
59 bool ValidParameters::isValidParameter(string parameter) {
60         try {   
61         
62                 //is the parameter in the map
63                 if ((parameters.find(parameter)) != (parameters.end())) {
64                         return true;
65                 }else{
66                         cout << parameter << " is not a valid parameter in Mothur." << endl;
67                         return false;
68                 }
69                 
70         }
71         catch(exception& e) {
72                 cout << "Standard Error: " << e.what() << " has occurred in the ValidParameters class Function isValidParameter. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
73                 exit(1);
74         }
75         catch(...) {
76                 cout << "An unknown error has occurred in the ValidParameters class function isValidParameter. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
77                 exit(1);
78         }
79 }
80
81 /***********************************************************************/