]> git.donarmstrong.com Git - mothur.git/blob - mothur.cpp
modified read.otu and shared command
[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                         #if defined (__APPLE__) || (__MACH__)
28                                 mothurOutJustToLog("Mac version");
29                                 mothurOutEndLine(); mothurOutEndLine();
30                         #else
31                                 mothurOutJustToLog("Linux version");
32                                 mothurOutEndLine(); mothurOutEndLine();
33                         #endif
34
35                 #else
36                         mothurOutJustToLog("Windows version");
37                         mothurOutEndLine(); mothurOutEndLine();
38                 #endif          
39
40                 
41                 //header
42                 mothurOut("mothur v.1.4.1");
43                 mothurOutEndLine();             
44                 mothurOut("Last updated: 6/23/2009");
45                 mothurOutEndLine();     
46                 mothurOutEndLine();             
47                 mothurOut("by");
48                 mothurOutEndLine();             
49                 mothurOut("Patrick D. Schloss");
50                 mothurOutEndLine();
51                 mothurOutEndLine();                     
52                 mothurOut("Department of Microbiology");
53                 mothurOutEndLine();             
54                 mothurOut("pschloss@micro.umass.edu");
55                 mothurOutEndLine();             
56                 mothurOut("http://schloss.micro.umass.edu/mothur");
57                 mothurOutEndLine();     
58                 mothurOutEndLine();     
59                 mothurOutEndLine();             
60                 mothurOut("Distributed under the GNU General Public License");
61                 mothurOutEndLine();
62                 mothurOutEndLine();                     
63                 mothurOut("Type 'help()' for information on the commands that are available");
64                 mothurOutEndLine();
65                 mothurOutEndLine();                     
66                 mothurOut("Type 'quit()' to exit program");
67                 mothurOutEndLine();     
68
69                                 
70                 //srand(54321);
71                 srand( (unsigned)time( NULL ) );
72
73                 Engine* mothur;
74                 bool bail = 0;
75                 string input;
76
77                 if(argc>1){
78                         input = argv[1];
79
80                         if (input[0] == '#') {
81                                 mothur = new ScriptEngine(argv[0], argv[1]);
82                         }else{
83                                 mothur = new BatchEngine(argv[0], argv[1]);
84                         }
85                 }
86                 else{
87                         mothur = new InteractEngine(argv[0]);           
88                 }
89
90                 while(bail == 0)                {       bail = mothur->getInput();                      }
91         
92                 delete mothur;
93         
94                 return 0;
95         }
96         catch(exception& e) {
97                 errorOut(e, "mothur", "main");
98                 exit(1);
99         }
100 }
101
102 /**************************************************************************************************/
103