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();
46 mothurOutJustToLog("Using ReadLine");
47 mothurOutEndLine(); mothurOutEndLine();
51 mothurOut("mothur v.1.8");
53 mothurOut("Last updated: 2/02/2010");
58 mothurOut("Patrick D. Schloss");
61 mothurOut("Department of Microbiology & Immunology");
63 mothurOut("University of Michigan");
65 mothurOut("pschloss@umich.edu");
67 mothurOut("http://www.mothur.org");
70 mothurOut("When using, please cite:");
72 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.");
75 mothurOut("Distributed under the GNU General Public License");
78 mothurOut("Type 'help()' for information on the commands that are available");
81 mothurOut("Type 'quit()' to exit program");
86 srand( (unsigned)time( NULL ) );
95 if (input[0] == '#') {
96 mothur = new ScriptEngine(argv[0], argv[1]);
98 mothur = new BatchEngine(argv[0], argv[1]);
102 mothur = new InteractEngine(argv[0]);
105 while(bail == 0) { bail = mothur->getInput(); }
107 string outputDir = mothur->getOutputDir();
108 logFileName = outputDir + logFileName;
110 //need this because mothur.h makes the logfile, but doesn't know where to put it
111 rename(log.c_str(), logFileName.c_str()); //logfile with timestamp
117 catch(exception& e) {
118 errorOut(e, "mothur", "main");
123 /**************************************************************************************************/