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