]> git.donarmstrong.com Git - mothur.git/blob - mothur.cpp
Initial revision
[mothur.git] / mothur.cpp
1 /*
2  *  interface.cpp
3  *  
4  *
5  *  Created by Pat Schloss on 8/14/08.
6  *  Copyright 2008 Patrick D. Schloss. All rights reserved.
7  *
8  */
9 #include <string>
10 #include <iostream>
11 #include <iomanip>
12 #include <fstream>
13 #include <sstream>
14 #include <exception>
15
16 #include "engine.hpp"
17 #include "globaldata.hpp"
18
19 using namespace std;
20
21 GlobalData* GlobalData::_uniqueInstance = 0;
22
23 int main(int argc, char *argv[]){
24         try {
25         //      srand(54321);
26                 srand( (unsigned)time( NULL ) );
27
28                 Engine* dotur;
29                 bool bail = 0;
30
31                 if(argc>1){
32                         dotur = new BatchEngine(argv[1]);
33                 }
34                 else{
35                         dotur = new InteractEngine();           
36                 }
37
38                 while(bail == 0)                {       bail = dotur->getInput();                       }
39         
40                 delete dotur;
41         
42                 return 0;
43         }
44         catch(exception& e) {
45                 cout << "Standard Error: " << e.what() << " has occurred in the dotur class Function main. 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 dotur class function main. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
50                 exit(1);
51         }
52 }
53