5 * Created by Pat Schloss on 8/14/08.
6 * Copyright 2008 Patrick D. Schloss. All rights reserved.
12 #include "globaldata.hpp"
14 /**************************************************************************************************/
16 GlobalData* GlobalData::_uniqueInstance = 0;
17 CommandFactory* CommandFactory::_uniqueInstance = 0;
19 int main(int argc, char *argv[]){
22 string log = "mothur.logFile";
25 time_t ltime = time(NULL); /* calendar time */
26 string logFileName = "mothur." + toString(ltime) + ".logfile";
29 #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
31 #if defined (__APPLE__) || (__MACH__)
32 mothurOutJustToLog("Mac version");
33 mothurOutEndLine(); mothurOutEndLine();
35 mothurOutJustToLog("Linux version");
36 mothurOutEndLine(); mothurOutEndLine();
41 mothurOutJustToLog("Windows version");
42 mothurOutEndLine(); mothurOutEndLine();
47 mothurOut("mothur v.1.8");
49 mothurOut("Last updated: 2/02/2010");
54 mothurOut("Patrick D. Schloss");
57 mothurOut("Department of Microbiology & Immunology");
59 mothurOut("University of Michigan");
61 mothurOut("pschloss@umich.edu");
63 mothurOut("http://www.mothur.org");
66 mothurOut("When using, please cite:");
68 mothurOut("Schloss, P.D., et al., Introducing mothur: Open-source, platform-independent, community-supported software for describing and comparing microbial communities. Appl Environ Microbiol, 2009. 75(23):7537-41.");
71 mothurOut("Distributed under the GNU General Public License");
74 mothurOut("Type 'help()' for information on the commands that are available");
77 mothurOut("Type 'quit()' to exit program");
82 srand( (unsigned)time( NULL ) );
91 if (input[0] == '#') {
92 mothur = new ScriptEngine(argv[0], argv[1]);
94 mothur = new BatchEngine(argv[0], argv[1]);
98 mothur = new InteractEngine(argv[0]);
101 while(bail == 0) { bail = mothur->getInput(); }
103 string outputDir = mothur->getOutputDir();
104 logFileName = outputDir + logFileName;
106 //need this because mothur.h makes the logfile, but doesn't know where to put it
107 rename(log.c_str(), logFileName.c_str()); //logfile with timestamp
113 catch(exception& e) {
114 errorOut(e, "mothur", "main");
119 /**************************************************************************************************/