]> git.donarmstrong.com Git - mothur.git/blob - errorchecking.cpp
eaf49dfe6937c4201330981cacf8cb5bfbf198cc
[mothur.git] / errorchecking.cpp
1 /*
2  *  errorchecking.cpp
3  *  Dotur
4  *
5  *  Created by Sarah Westcott on 1/2/09.
6  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
7  *
8  */
9
10 #include "errorchecking.h"
11
12 /*******************************************************/
13
14 /******************************************************/
15
16 ErrorCheck::ErrorCheck() {
17         globaldata = GlobalData::getInstance();
18         validCommand = new ValidCommands();
19         validParameter = new ValidParameters();
20 }
21 /*******************************************************/
22
23 /******************************************************/
24
25 void ErrorCheck::refresh() {
26
27         //columnfile = globaldata->getColumnFile();
28         //phylipfile = globaldata->getPhylipFile();
29         //listfile = globaldata->getListFile();
30         //rabundfile = globaldata->getRabundFile();
31         //sabundfile = globaldata->getSabundFile();
32         //namefile = globaldata->getNameFile();
33         //groupfile = globaldata->getGroupFile();
34         //orderfile = globaldata->getOrderFile();
35         //fastafile = globaldata->getFastaFile();
36         //treefile = globaldata->getTreeFile();
37         //cutoff = globaldata->getCutOff();
38         //format = globaldata->getFormat();
39         //method = globaldata->getMethod();
40         //randomtree = globaldata->getRandomTree();
41         //sharedfile = globaldata->getSharedFile();
42
43 }
44
45 /*******************************************************/
46
47 /******************************************************/
48
49 ErrorCheck::~ErrorCheck() {
50         delete validCommand;
51         delete validParameter;
52 }
53
54 /*******************************************************/
55
56 /******************************************************/
57
58 bool ErrorCheck::checkInput(string input) {
59                 errorFree = true;
60                 clear();
61                 
62                 //refresh variable
63                 refresh();
64                 
65                 //get command name and parameters
66                 int openParen = input.find_first_of('(');
67                 int closeParen = input.find_last_of(')');
68
69                 if(openParen != -1 && closeParen != -1){                        
70                         commandName = input.substr(0, openParen);   //commandName contains everything before "("
71                         optionText = input.substr(openParen+1, closeParen-openParen-1); //optionString contains everything between "(" and ")".
72                 }else if (openParen == -1) { //there is no parenthesis
73                         cout << input << " is not a valid command. You are missing the ()." << endl;
74                         return false;
75                 }
76                 
77                 //is it a valid command
78                 if (validCommand->isValidCommand(commandName) != true) { return false; }
79                 string parameter, value;
80                 
81                 //reads in parameters and values
82                 if((optionText != "") && (commandName != "help")){
83                         while((optionText.find_first_of(',') != -1) && (errorFree)) {  //while there are parameters
84                                 splitAtComma(value, optionText);
85                                 splitAtEquals(parameter, value);
86                                 
87                                 //is it a valid parameter
88                                 if (validParameter->isValidParameter(parameter, commandName, value) != true) { return false; }
89                                 
90                                 if (parameter == "phylip" )             { phylipfile = value; }
91                                 if (parameter == "column" )             { columnfile = value; }
92                                 if (parameter == "list" )               { listfile = value; }
93                                 if (parameter == "rabund" )             { rabundfile = value; }
94                                 if (parameter == "sabund" )             { sabundfile = value; }
95                                 if (parameter == "name" )               { namefile = value; }
96                                 if (parameter == "order" )              { orderfile = value; }
97                                 if (parameter == "fasta" )              { fastafile = value; }
98                                 if (parameter == "nexus" )              { nexusfile = value; }
99                                 if (parameter == "clustal" )    { clustalfile = value; }
100                                 if (parameter == "tree" )               { treefile = value; }
101                                 if (parameter == "group" )                      { groupfile = value; }
102                                 if (parameter == "shared" )                     { sharedfile = value; }
103                                 if (parameter == "cutoff" )                     { cutoff = value; }
104                                 if (parameter == "precision" )          { precision = value; }
105                                 if (parameter == "iters" )                      { iters = value; }
106                                 if (parameter == "jumble" )                     { jumble = value; }
107                                 if (parameter == "freq" )                       { freq = value; }
108                                 if (parameter == "method" )                     { method = value; }
109                                 if (parameter == "fileroot" )           { fileroot = value; }
110                                 if (parameter == "line" )                       { line = value; }
111                                 if (parameter == "label" )                      { label = value; }
112                                 if (parameter == "abund" )          { abund = value; }
113                                 if (parameter == "random" )                     { randomtree = value; }
114                                 if (parameter == "sorted" )                     { sorted = value; }
115                                 if (parameter == "trump" )          { trump = value; }
116                                 if (parameter == "soft" )                       { soft = value; }
117                                 if (parameter == "filter" )         { filter = value; }
118                                 if (parameter == "scale" )                      { scale = value;        }
119
120                         }
121                         
122                         //gets the last parameter and value
123                         if (errorFree)  { //gets the last parameter and value
124                                 value = optionText;
125                                 splitAtEquals(parameter, value);
126                                 //is it a valid parameter
127                                 if (validParameter->isValidParameter(parameter, commandName, value) != true) { return false; }
128         
129                                 
130                                 if (parameter == "phylip" )             { phylipfile = value; }
131                                 if (parameter == "column" )             { columnfile = value; }                         
132                                 if (parameter == "list" )               { listfile = value; }
133                                 if (parameter == "rabund" )             { rabundfile = value; }
134                                 if (parameter == "sabund" )             { sabundfile = value; }
135                                 if (parameter == "name" )               { namefile = value; }
136                                 if (parameter == "order" )              { orderfile = value; }
137                                 if (parameter == "group" )              { groupfile = value; }
138                                 if (parameter == "shared" )             { sharedfile = value; }
139                                 if (parameter == "fasta" )              { fastafile = value; }
140                                 if (parameter == "nexus" )              { nexusfile = value; }
141                                 if (parameter == "clustal" )    { clustalfile = value; }
142                                 if (parameter == "tree" )               { treefile = value; }
143                                 if (parameter == "cutoff" )                     { cutoff = value; }
144                                 if (parameter == "precision" )          { precision = value; }
145                                 if (parameter == "iters" )                      { iters = value; }
146                                 if (parameter == "jumble" )                     { jumble = value; }
147                                 if (parameter == "freq" )                       { freq = value; }
148                                 if (parameter == "method" )                     { method = value; }
149                                 if (parameter == "fileroot" )           { fileroot = value; }
150                                 if (parameter == "line" )                       { line = value; }
151                                 if (parameter == "label" )                      { label = value; }
152                                 if (parameter == "random" )                     { randomtree = value;   }
153                                 if (parameter == "abund" )          { abund = value; }
154                                 if (parameter == "sorted" )                     { sorted = value;       }
155                                 if (parameter == "trump" )          { trump = value; }
156                                 if (parameter == "soft" )                       { soft = value; }
157                                 if (parameter == "filter" )         { filter = value; }
158                                 if (parameter == "scale" )                      { scale = value;        }
159
160                         }
161                 }
162                 
163                 //make sure the user does not use both the line and label parameters
164                 if ((line != "") && (label != "")) { cout << "You may use either the line or label parameters, but not both." << endl; return false; }
165                 
166                 //check for valid files 
167                 if (commandName == "read.dist") { 
168                         validateReadFiles();
169                         validateReadDist();
170                 }else if (commandName == "read.otu") { 
171                         //you want to do shared commands
172                         if ((listfile != "") && (groupfile != ""))      {
173                                 validateParseFiles(); //checks the listfile and groupfile parameters
174                         //you want to do single commands
175                         }else if ((listfile != "") || (rabundfile != "") || (sabundfile != "")){ 
176                                 validateReadFiles();
177                                 validateReadPhil();
178                         //you have not given a file
179                         }else if ((listfile == "") && (sharedfile == "") && (rabundfile == "") && (sabundfile == "")) {
180                                 cout << "You must enter either a listfile, rabundfile, sabundfile or a sharedfile with the read.otu command. " << endl; return false; 
181                         //you want to do shared commands with a shared file
182                         }else if (sharedfile != "") {//you are reading a shared file
183                                 validateReadFiles();
184                         }
185                 }else if (commandName == "read.tree") { 
186                         validateTreeFiles(); //checks the treefile and groupfile parameters
187                 }else if (commandName == "read.seqs") {
188                         if ((fastafile == "") && (nexusfile == "") && (clustalfile == "") && (phylipfile == "")) { cout << "You must enter a fastafile, nexusfile, or clustalfile with the read.seqs() command." << endl; return false; }
189                 }else if (commandName == "deconvolute") {
190                         if (fastafile == "") { cout << "You must enter a fastafile with the deconvolute() command." << endl; return false; }
191                         validateReadFiles();
192                 }
193                 
194                 //are you trying to cluster before you have read something      
195                 if (((commandName == "cluster") && (globaldata->gSparseMatrix == NULL)) ||
196                         ((commandName == "cluster") && (globaldata->gListVector == NULL))) {
197                                 cout << "Before you use the cluster command, you first need to read in a distance matrix." << endl; 
198                                 errorFree = false;
199                 } 
200                 
201                 if ((commandName == "libshuff") && ((globaldata->gMatrix == NULL) || (globaldata->gGroupmap == NULL))) {
202                          cout << "You must read in a matrix and groupfile using the read.dist command, before you use the libshuff command. " << endl; return false; 
203                 }
204                 
205                 if (commandName == "parsimony") {
206                         //are you trying to use parsimony without reading a tree or saying you want random distribution
207                         if (randomtree == "")  {
208                                 if (globaldata->gTree.size() == 0) {
209                                         cout << "You must read a treefile and a groupfile or set the randomtree parameter to the output filename you wish, before you may execute the parsimony command." << endl; return false;  }
210                         }
211                 }
212                 
213                 if ((commandName == "unifrac.weighted") || (commandName == "unifrac.unweighted") || (commandName == "concensus")) {
214                         if (globaldata->gTree.size() == 0) {//no trees were read
215                                 cout << "You must execute the read.tree command, before you may execute the unifrac.weighted, unifrac.unweighted or concensus command." << endl; return false;  }
216                 }
217                 
218                 //check for valid method
219                 if(commandName == "get.group") {
220                         if ((globaldata->getGroupFile() == "")) { cout << "You must read a group before you can use the get.group command." << endl; return false; }
221                 }
222                 if (commandName == "get.label" || commandName == "get.line") {
223                         if ((globaldata->getListFile() == "") && (globaldata->getRabundFile() == "") && (globaldata->getSabundFile() == "")) { cout << "You must read a list, sabund or rabund before you can use the get.label or get.line command." << endl; return false; }
224                 }
225                 if (commandName == "cluster") {
226                         if ((method == "furthest") || (method == "nearest") || (method == "average")) { }
227                         else {cout << "Not a valid clustering method.  Valid clustering algorithms are furthest, nearest or average." << endl; return false; }
228                 }
229                 
230                 if ((commandName == "collect.single") || (commandName == "rarefaction.single") || (commandName == "summary.single") ){ 
231                         if ((globaldata->getListFile() == "") && (globaldata->getRabundFile() == "") && (globaldata->getSabundFile() == "")) { cout << "You must read a list, sabund or rabund before you can use the collect.single, rarefaction.single or summary.single commands." << endl; return false; }
232                 }
233                 
234                 if ((commandName == "collect.shared") || (commandName == "rarefaction.shared") || (commandName == "summary.shared") || (commandName == "tree.shared") || (commandName == "bootstrap.shared")){ 
235                         if (globaldata->getSharedFile() == "") {
236                                 if (globaldata->getListFile() == "") { cout << "You must read a list and a group, or a shared before you can use the collect.shared, rarefaction.shared, summary.shared, tree.shared or bootstrap.shared commands." << endl; return false; }
237                                 else if (globaldata->getGroupFile() == "") { cout << "You must read a list and a group, or a shared before you can use the collect.shared, rarefaction.shared, summary.shared, tree.shared or bootstrap.shared commands." << endl; return false; }
238                         }
239                 }
240                 
241                 if ((commandName == "heatmap") || (commandName == "venn")) { 
242                         if ((globaldata->getListFile() == "") && (globaldata->getSharedFile() == "")) {
243                                  cout << "You must read a list, or a list and a group, or a shared before you can use the heatmap or venn commands." << endl; return false; 
244                         }
245                 }
246                 
247                 if (commandName == "filter.seqs"){ 
248                         if ((globaldata->getFastaFile() == "") && (globaldata->getNexusFile() == "") && (globaldata->getClustalFile() == "") && (globaldata->getPhylipFile() == "")) {
249                                  cout << "You must read either a fasta, nexus, clustal, or phylip file before you can use the filter.seqs command." << endl; return false; 
250                         }
251                 }
252                 
253                 if ((commandName == "bin.seqs")) { 
254                         if ((globaldata->getListFile() == "")) { cout << "You must read a list file before you can use the bin.seqs command." << endl; return false; }
255                         validateBinFiles();
256                 }
257                 
258                 if ((commandName == "get.oturep")) { 
259                         if ((globaldata->gSparseMatrix == NULL) || (globaldata->gListVector == NULL)) {
260                                 cout << "Before you use the get.oturep command, you first need to read in a distance matrix." << endl; 
261                                 errorFree = false;
262                         }
263                         if (listfile == "") { cout << "list is a required parameter for the get.oturep command." << endl; errorFree = false; }
264                         validateBinFiles();
265                 } 
266
267
268                 return errorFree;
269 }
270
271 /*******************************************************/
272
273 /******************************************************/
274 //This function checks to make sure the user entered a file to 
275 // read and that the file exists and can be opened.
276 void ErrorCheck::validateReadFiles() {
277         try {
278                 //Validating files for read
279                 ifstream filehandle;
280                 int ableToOpen;
281         
282                 //are we reading a phylipfile
283                 if (phylipfile != "") {
284                         ableToOpen = openInputFile(phylipfile, filehandle);
285                         filehandle.close();
286                         //unable to open
287                         if (ableToOpen == 1) { errorFree = false; }
288                         else { globaldata->inputFileName = phylipfile; }
289                 //are we reading a columnfile
290                 }else if (columnfile != "") {
291                         ableToOpen = openInputFile(columnfile, filehandle);
292                         filehandle.close();
293                         //unable to open
294                         if (ableToOpen == 1) { errorFree = false; }
295                         else { globaldata->inputFileName = columnfile; }
296                 //are we reading a listfile
297                 }else if (listfile!= "") {
298                         ableToOpen = openInputFile(listfile, filehandle);
299                         filehandle.close();
300                         //unable to open
301                         if (ableToOpen == 1) {  errorFree = false; }
302                         else { globaldata->inputFileName = listfile; }
303                 //are we reading a rabundfile
304                 }else if (rabundfile != "") {
305                         ableToOpen = openInputFile(rabundfile, filehandle);
306                         filehandle.close();
307                         //unable to open
308                         if (ableToOpen == 1) {  errorFree = false; }
309                         else { globaldata->inputFileName = rabundfile; }
310                 //are we reading a sabundfile
311                 }else if (sabundfile != "") {
312                         ableToOpen = openInputFile(sabundfile, filehandle);
313                         filehandle.close();
314                         //unable to open
315                         if (ableToOpen == 1) {  errorFree = false; }
316                         else { globaldata->inputFileName = sabundfile; }
317                 }else if (fastafile != "") {
318                         ableToOpen = openInputFile(fastafile, filehandle);
319                         filehandle.close();
320                         //unable to open
321                         if (ableToOpen == 1) {  errorFree = false; }
322                         else { globaldata->inputFileName = fastafile; }
323                 }else if (sharedfile != "") {
324                         ableToOpen = openInputFile(sharedfile, filehandle);
325                         filehandle.close();
326                         //unable to open
327                         if (ableToOpen == 1) {  errorFree = false; }
328                         else { globaldata->inputFileName = sharedfile; }
329                 }else{ //no file given
330                         errorFree = false;
331                 }
332         }
333         catch(exception& e) {
334                 cout << "Standard Error: " << e.what() << " has occurred in the ErrorCheck class Function validateReadFiles. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
335                 exit(1);
336         }
337         catch(...) {
338                 cout << "An unknown error has occurred in the ErrorCheck class function validateReadFiles. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
339                 exit(1);
340         }
341         
342 }
343 /*******************************************************/
344
345 /******************************************************/
346 //This function checks to make sure the user entered appropriate
347 // format parameters on a distfile read
348 void ErrorCheck::validateReadDist() {
349         try {
350                 ifstream filehandle;
351                 int ableToOpen;
352                 
353                 if (groupfile != "") {
354                         ableToOpen = openInputFile(groupfile, filehandle);
355                         filehandle.close();
356                         //unable to open
357                         if (ableToOpen == 1) {  errorFree = false; }
358                 }
359                 
360                 if ((phylipfile == "") && (columnfile == "")) { cout << "When executing a read.dist you must enter a phylip or a column." << endl; errorFree = false; }
361                 else if ((phylipfile != "") && (columnfile != "")) { cout << "When executing a read.dist you must enter ONLY ONE of the following: phylip or column." << endl; errorFree = false; }
362                 
363                 if (columnfile != "") {
364                         if (namefile == "") {
365                                 cout << "You need to provide a namefile if you are going to use the column format." << endl;
366                                 errorFree = false; 
367                         }else {
368                                 ableToOpen = openInputFile(namefile, filehandle);
369                                 filehandle.close();
370                                 //unable to open
371                                 if (ableToOpen == 1) { errorFree = false; }
372                         }
373                 }
374         }
375         catch(exception& e) {
376                 cout << "Standard Error: " << e.what() << " has occurred in the ErrorCheck class Function validateReadDist. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
377                 exit(1);
378         }
379         catch(...) {
380                 cout << "An unknown error has occurred in the ErrorCheck class function validateReadDist. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
381                 exit(1);
382         }
383 }
384 /*******************************************************/
385
386 /******************************************************/
387 //This function checks to make sure the user entered appropriate
388 // format parameters on a parselistcommand
389 void ErrorCheck::validateParseFiles() {
390         try {
391                 ifstream filehandle;
392                 int ableToOpen;
393                 
394                 //checks for valid files
395         
396                 if (listfile == "") { cout << "When executing a read.otu for groups you must enter a list and a group." << endl; errorFree = false; }
397                 else if (groupfile == "") { cout << "When executing a read.otu for groups you must enter a list and a group." << endl; errorFree = false; }
398         
399                 //checks parameters on the read command
400                 if (listfile != "") {
401                         ableToOpen = openInputFile(listfile, filehandle);
402                         filehandle.close();
403                         if (ableToOpen == 1) { //unable to open
404                                 errorFree = false;
405                         }
406                         if (groupfile != "") {
407                                 ableToOpen = openInputFile(groupfile, filehandle);
408                                 filehandle.close();
409                                 if (ableToOpen == 1) { //unable to open
410                                         errorFree = false;;
411                                 }
412                         }
413                 }
414         }
415         catch(exception& e) {
416                 cout << "Standard Error: " << e.what() << " has occurred in the ErrorCheck class Function validateReadPhil. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
417                 exit(1);
418         }
419         catch(...) {
420                 cout << "An unknown error has occurred in the ErrorCheck class function validateReadPhil. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
421                 exit(1);
422         }
423 }
424 /*******************************************************/
425
426 /******************************************************/
427 //This function checks to make sure the user entered appropriate
428 // format parameters on a parselistcommand
429 void ErrorCheck::validateTreeFiles() {
430         try {
431                 ifstream filehandle;
432                 int ableToOpen;
433                 
434                 //checks for valid files
435         
436                 if (treefile == "") { cout << "When executing a read.tree you must enter a treefile and a groupfile." << endl; errorFree = false; }
437                 else if (groupfile == "") { cout << "When executing a read.tree you must enter a treefile and a groupfile." << endl; errorFree = false; }
438         
439                 //checks parameters on the read command
440                 if (treefile != "") {
441                         ableToOpen = openInputFile(treefile, filehandle);
442                         filehandle.close();
443                         if (ableToOpen == 1) { //unable to open
444                                 errorFree = false;
445                         }
446                         if (groupfile != "") {
447                                 ableToOpen = openInputFile(groupfile, filehandle);
448                                 filehandle.close();
449                                 if (ableToOpen == 1) { //unable to open
450                                         errorFree = false;;
451                                 }
452                         }
453                 }
454         }
455         catch(exception& e) {
456                 cout << "Standard Error: " << e.what() << " has occurred in the ErrorCheck class Function validateTreeFiles. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
457                 exit(1);
458         }
459         catch(...) {
460                 cout << "An unknown error has occurred in the ErrorCheck class function validateTreeFiles. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
461                 exit(1);
462         }
463 }
464
465 /*******************************************************/
466
467 /******************************************************/
468 //This function checks to make sure the user entered appropriate
469 // format parameters on a distfile read
470 void ErrorCheck::validateReadPhil() {
471         try {
472                 ifstream filehandle;
473                 int ableToOpen;
474                 
475                 //checks to make sure only one file type is given
476                 if (listfile != "") { 
477                         if ((rabundfile != "") || (sabundfile != "")) { 
478                                 cout << "When executing a read.otu you must enter ONLY ONE of the following: list, rabund or sabund." << endl; errorFree = false; }
479                 }else if (rabundfile != "") { 
480                         if ((listfile != "") || (sabundfile != "")) { 
481                                 cout << "When executing a read.otu you must enter ONLY ONE of the following: list, rabund or sabund." << endl; errorFree = false; }
482                 }else if (sabundfile != "") { 
483                         if ((listfile != "") || (rabundfile != "")) { 
484                                 cout << "When executing a read.otu you must enter ONLY ONE of the following: list, rabund or sabund." << endl; errorFree = false; }
485                 }else if ((listfile == "") && (rabundfile == "") && (sabundfile == "") && (sharedfile == "")) {
486                             cout << "When executing a read.otu you must enter one of the following: list, rabund or sabund." << endl; errorFree = false; 
487                 }
488                 
489                 //checks parameters on the read command
490                 if (orderfile != "") {
491                         ableToOpen = openInputFile(orderfile, filehandle);
492                         filehandle.close();
493                         if (ableToOpen == 1) { //unable to open
494                                 errorFree = false;
495                         }
496                 }       
497         }
498         catch(exception& e) {
499                 cout << "Standard Error: " << e.what() << " has occurred in the ErrorCheck class Function validateReadPhil. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
500                 exit(1);
501         }
502         catch(...) {
503                 cout << "An unknown error has occurred in the ErrorCheck class function validateReadPhil. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
504                 exit(1);
505         }
506 }
507 /*******************************************************/
508
509 /******************************************************/
510 //This function checks to make sure the user entered appropriate
511 // format parameters on a bin.seq command
512 void ErrorCheck::validateBinFiles() {
513         try {
514                 ifstream filehandle;
515                 int ableToOpen;
516                 
517                 if (fastafile == "") {
518                                 cout << "fasta is a required parameter for bin.seqs and get.oturep commands." << endl; errorFree = false; 
519                 }else if (fastafile != "") {
520                         //is it a valid filename'
521                         ableToOpen = openInputFile(fastafile, filehandle);
522                         filehandle.close();
523                         //unable to open
524                         if (ableToOpen == 1) {  errorFree = false; }
525                 }else if (listfile != "") {
526                         //is it a valid filename'
527                         ableToOpen = openInputFile(listfile, filehandle);
528                         filehandle.close();
529                         //unable to open
530                         if (ableToOpen == 1) {  errorFree = false; }
531                 }else if (globaldata->getNameFile() != "") {
532                         //is it a valid filename'
533                         ifstream filehandle;
534                         int ableToOpen = openInputFile(globaldata->getNameFile(), filehandle);
535                         filehandle.close();
536                         //unable to open
537                         if (ableToOpen == 1) {  errorFree = false; }
538                 }else if (namefile != "") {
539                         //is it a valid filename'
540                         ifstream filehandle;
541                         int ableToOpen = openInputFile(namefile, filehandle);
542                         filehandle.close();
543                         //unable to open
544                         if (ableToOpen == 1) {  errorFree = false; }
545                 }
546
547
548         }
549         catch(exception& e) {
550                 cout << "Standard Error: " << e.what() << " has occurred in the ErrorCheck class Function validateBinFiles. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
551                 exit(1);
552         }
553         catch(...) {
554                 cout << "An unknown error has occurred in the ErrorCheck class function validateBinFiles. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
555                 exit(1);
556         }
557 }
558
559 /*******************************************************/
560
561 /******************************************************/
562
563 void ErrorCheck::clear() {
564         //option definitions should go here...
565         phylipfile              =       "";
566         columnfile              =       "";
567         listfile                =       "";
568         rabundfile              =       "";
569         sabundfile              =       "";
570         namefile                =       "";
571         groupfile               =       ""; 
572         orderfile               =       "";
573         sharedfile              =       "";
574         fastafile       =   "";
575         nexusfile       =   "";
576         clustalfile     =   "";
577         line                    =       "";
578         label                   =       "";
579         method                  =   "furthest";
580 }
581 /*******************************************************/
582
583 /******************************************************/
584