]> git.donarmstrong.com Git - mothur.git/blob - mothur.cpp
fixed bug with aligner in database class, worked on chimeras
[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  
10 #include "mothur.h"
11 #include "engine.hpp"
12 #include "globaldata.hpp"
13
14 /**************************************************************************************************/
15
16 GlobalData* GlobalData::_uniqueInstance = 0;
17
18 int main(int argc, char *argv[]){
19         try {
20                 
21                 //remove old logfile
22                 string logFileName = "mothur.logFile";
23                 remove(logFileName.c_str());
24                 
25                 //version
26                 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
27                         system("clear");
28                         #if defined (__APPLE__) || (__MACH__)
29                                 mothurOutJustToLog("Mac version");
30                                 mothurOutEndLine(); mothurOutEndLine();
31                         #else
32                                 mothurOutJustToLog("Linux version");
33                                 mothurOutEndLine(); mothurOutEndLine();
34                         #endif
35
36                 #else
37                         system("CLS");
38                         mothurOutJustToLog("Windows version");
39                         mothurOutEndLine(); mothurOutEndLine();
40                 #endif          
41
42                 
43                 //header
44                 mothurOut("mothur v.1.4.1");
45                 mothurOutEndLine();             
46                 mothurOut("Last updated: 6/23/2009");
47                 mothurOutEndLine();     
48                 mothurOutEndLine();             
49                 mothurOut("by");
50                 mothurOutEndLine();             
51                 mothurOut("Patrick D. Schloss");
52                 mothurOutEndLine();
53                 mothurOutEndLine();                     
54                 mothurOut("Department of Microbiology");
55                 mothurOutEndLine();             
56                 mothurOut("pschloss@micro.umass.edu");
57                 mothurOutEndLine();             
58                 mothurOut("http://schloss.micro.umass.edu/mothur");
59                 mothurOutEndLine();     
60                 mothurOutEndLine();     
61                 mothurOutEndLine();             
62                 mothurOut("Distributed under the GNU General Public License");
63                 mothurOutEndLine();
64                 mothurOutEndLine();                     
65                 mothurOut("Type 'help()' for information on the commands that are available");
66                 mothurOutEndLine();
67                 mothurOutEndLine();                     
68                 mothurOut("Type 'quit()' to exit program");
69                 mothurOutEndLine();     
70
71                                 
72                 //srand(54321);
73                 srand( (unsigned)time( NULL ) );
74
75                 Engine* mothur;
76                 bool bail = 0;
77                 string input;
78
79                 if(argc>1){
80                         input = argv[1];
81
82                         if (input[0] == '#') {
83                                 mothur = new ScriptEngine(argv[0], argv[1]);
84                         }else{
85                                 mothur = new BatchEngine(argv[0], argv[1]);
86                         }
87                 }
88                 else{
89                         mothur = new InteractEngine(argv[0]);           
90                 }
91
92                 while(bail == 0)                {       bail = mothur->getInput();                      }
93         
94                 delete mothur;
95         
96                 return 0;
97         }
98         catch(exception& e) {
99                 errorOut(e, "mothur", "main");
100                 exit(1);
101         }
102 }
103
104 /**************************************************************************************************/
105