+
+ //look for uchime exe
+ path = m->argv;
+ string tempPath = path;
+ for (int i = 0; i < path.length(); i++) { tempPath[i] = tolower(path[i]); }
+ path = path.substr(0, (tempPath.find_last_of('m')));
+
+ string uchimeCommand;
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ uchimeCommand = path + "uchime"; // format the database, -o option gives us the ability
+#else
+ uchimeCommand = path + "uchime.exe";
+#endif
+
+ //test to make sure uchime exists
+ ifstream in;
+ uchimeCommand = m->getFullPathName(uchimeCommand);
+ int ableToOpen = m->openInputFile(uchimeCommand, in, "no error"); in.close();
+ if(ableToOpen == 1) { m->mothurOut("[ERROR]: " + uchimeCommand + " file does not exist. mothur requires the uchime executable."); m->mothurOutEndLine(); abort = true; }