GCC_OPTIMIZATION_LEVEL = 3;
GCC_PREPROCESSOR_DEFINITIONS = (
"MOTHUR_FILES=\"\\\"../release\\\"\"",
- "VERSION=\"\\\"1.21.0\\\"\"",
- "RELEASE_DATE=\"\\\"7/25/2011\\\"\"",
+ "VERSION=\"\\\"1.22.0\\\"\"",
+ "RELEASE_DATE=\"\\\"10/12/2011\\\"\"",
);
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
-//#if UCHIMES\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+#if UCHIMES\r
+\r
#include "myutils.h"\r
#include "chime.h"\r
#include "ultra.h"\r
}\r
}\r
\r
-//#endif\r
+#endif\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#include "myutils.h"\r
#include "seq.h"\r
#include "chime.h"\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#include "myutils.h"\r
#include "seq.h"\r
#include "chime.h"\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef alnheuristics_h\r
#define alnheuristics_h\r
\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#include "myutils.h"\r
#include <float.h> // for FLT_MAX\r
#include "mx.h"\r
\r
#define TEST 0\r
\r
-void SetBLOSUM62();\r
+void SetBLOSUM62();
void SetNucSubstMx(double Match, double Mismatch);\r
void ReadSubstMx(const string &FileName, Mx<float> &Mxf);\r
-\r
-extern Mx<float> g_SubstMxf;\r
-extern float **g_SubstMx;\r
+
+extern Mx<float> g_SubstMxf;
+extern float **g_SubstMx;
\r
void AlnParams::Clear()\r
{\r
void AlnParams::SetMxFromCmdLine(bool IsNucleo)\r
{\r
if (IsNucleo)\r
- SetNucSubstMx(opt_match, opt_mismatch);\r
+ SetNucSubstMx(opt_match, opt_mismatch);
else\r
{\r
if (opt_matrix == "")\r
{\r
SubstMxName = "BLOSUM62";\r
- SetBLOSUM62();\r
- }\r
+ SetBLOSUM62();
+ }
else\r
{\r
ReadSubstMx(opt_matrix, g_SubstMxf);\r
\r
// Global\r
if (IsNucleo)\r
- Init4(g_SubstMx, -10.0, -1.0, -0.5, -0.5);\r
+ Init4(g_SubstMx, -10.0, -1.0, -0.5, -0.5);
else\r
- Init4(g_SubstMx, -17.0, -1.0, -0.5, -0.5);\r
+ Init4(g_SubstMx, -17.0, -1.0, -0.5, -0.5);
SetPenalties(opt_gapopen, opt_gapext);\r
}\r
\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef alnparams_h\r
#define alnparams_h\r
\r
// Generated by /p/py/alphac.py
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.
#include "alpha.h"
unsigned g_CharToLetterAminoStop[256] =
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef alpha_h\r
#define alpha_h\r
\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#include "myutils.h"\r
#include "alpha.h"\r
#include "timing.h"\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef chainer_h\r
#define chainer_h\r
\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef chime_h\r
#define chime_h\r
\r
createFilter(templateSeqs, 0.0); //just removed columns where all seqs have a gap
if (searchMethod == "distance") {
- createFilter(templateSeqs, 0.0); //just removed columns where all seqs have a gap
+ //createFilter(templateSeqs, 0.0); //just removed columns where all seqs have a gap
//run filter on template copying templateSeqs into filteredTemplateSeqs
for (int i = 0; i < templateSeqs.size(); i++) {
if (chimeraFlag == "yes") {
if ((chimeraResults[0].bsa >= minBS) || (chimeraResults[0].bsb >= minBS)) {
- m->mothurOut(querySeq.getName() + "\tyes"); m->mothurOutEndLine();
+ m->mothurOut(toString(threadID) +"\t"+ querySeq.getName() + "\tyes"); m->mothurOutEndLine();
outAcc << querySeq.getName() << endl;
if (templateFileName == "self") { chimericSeqs.insert(querySeq.getName()); }
if (hasName && (templatefile != "self")) { m->mothurOut("You have provided a namefile and the reference parameter is not set to self. I am not sure what reference you are trying to use, aborting."); m->mothurOutEndLine(); abort=true; }
if (hasGroup && (templatefile != "self")) { m->mothurOut("You have provided a group file and the reference parameter is not set to self. I am not sure what reference you are trying to use, aborting."); m->mothurOutEndLine(); abort=true; }
+ //until we resolve the issue 10-18-11
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#else
+ processors=1;
+#endif
}
}
catch(exception& e) {
map<string, map<string, int> > fileToPriority;
map<string, map<string, int> >::iterator itFile;
map<string, string> fileGroup;
- map<string, int> priority;
fileToPriority[fastaFileNames[s]] = priority; //default
fileGroup[fastaFileNames[s]] = "noGroup";
SequenceParser* parser = NULL;
priority = sortFastaFile(fastaFileNames[s], nameFile);
m->mothurOut("Done."); m->mothurOutEndLine();
+ fileToPriority.clear();
+ fileGroup.clear();
fileToPriority[fastaFileNames[s]] = priority;
+ fileGroup[fastaFileNames[s]] = "noGroup";
if (m->control_pressed) { for (int j = 0; j < outputNames.size(); j++) { m->mothurRemove(outputNames[j]); } return 0; }
}else if ((templatefile == "self") && (groupFile != "")) {
fileGroup.clear();
fileToPriority.clear();
+ if (processors != 1) { m->mothurOut("When using template=self, mothur can only use 1 processor, continuing."); m->mothurOutEndLine(); processors = 1; }
string nameFile = "";
if (nameFileNames.size() != 0) { //you provided a namefile and we don't need to create one
nameFile = nameFileNames[s];
if (print) {
out << name << '\t';
- cout << name<< endl;
+
namesInFile.insert(name);
//output parent1's name
pDataArray.push_back(tempslayer);
processIDS.push_back(i);
- //MySeqSumThreadFunction is in header. It must be global or static to work with the threads.
+ //MySlayerThreadFunction is in header. It must be global or static to work with the threads.
//default security attributes, thread function name, argument to thread function, use default creation flags, returns the thread identifier
hThreadArray[i] = CreateThread(NULL, 0, MySlayerThreadFunction, pDataArray[i], 0, &dwThreadIdArray[i]);
}
int setupChimera(string, map<string, int>&);
int MPIExecute(string, string, string, string);
int deconvoluteResults(SequenceParser*, string, string, string);
-
+ map<string, int> priority;
#ifdef USE_MPI
#include "chimerauchimecommand.h"
#include "deconvolutecommand.h"
-#include "uc.h"
+//#include "uc.h"
#include "sequence.hpp"
#include "referencedb.h"
if (hasName && (templatefile != "self")) { m->mothurOut("You have provided a namefile and the reference parameter is not set to self. I am not sure what reference you are trying to use, aborting."); m->mothurOutEndLine(); abort=true; }
if (hasGroup && (templatefile != "self")) { m->mothurOut("You have provided a group file and the reference parameter is not set to self. I am not sure what reference you are trying to use, aborting."); m->mothurOutEndLine(); abort=true; }
-
+
+ //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; }
}
}
catch(exception& e) {
int ChimeraUchimeCommand::driver(string outputFName, string filename, string accnos, string alns, int& numChimeras){
try {
-
+ //to allow for spaces in the path
+ outputFName = "\"" + outputFName + "\"";
+ filename = "\"" + filename + "\"";
+ alns = "\"" + alns + "\"";
+
vector<char*> cPara;
-
- char* tempUchime = new char[8];
- strcpy(tempUchime, "./uchime ");
+
+ char* tempUchime;
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ tempUchime= new char[10];
+ *tempUchime = '\0';
+ strncat(tempUchime, "./uchime ", 9);
+#else
+ tempUchime= new char[8];
+ *tempUchime = '\0';
+ strncat(tempUchime, "uchime ", 7);
+#endif
cPara.push_back(tempUchime);
char* tempIn = new char[8];
char** uchimeParameters;
uchimeParameters = new char*[cPara.size()];
- for (int i = 0; i < cPara.size(); i++) { uchimeParameters[i] = cPara[i]; }
- int numArgs = cPara.size();
+ string commandString = "";
+ for (int i = 0; i < cPara.size(); i++) { uchimeParameters[i] = cPara[i]; commandString += toString(cPara[i]) + " "; }
+ //int numArgs = cPara.size();
- uchime_main(numArgs, uchimeParameters);
+ //uchime_main(numArgs, uchimeParameters);
+ //cout << "commandString = " << commandString << endl;
+ system(commandString.c_str());
//free memory
- for(int i = 0; i < cPara.size(); i++) { delete[] cPara[i]; }
+ for(int i = 0; i < cPara.size(); i++) { delete cPara[i]; }
delete[] uchimeParameters;
+ //remove "" from filenames
+ outputFName = outputFName.substr(1, outputFName.length()-2);
+ filename = filename.substr(1, filename.length()-2);
+ alns = alns.substr(1, alns.length()-2);
+
if (m->control_pressed) { return 0; }
//create accnos file from uchime results
temp = validParameter.validFile(parameters, "ksize", false); if (temp == "not found"){ temp = "8"; }
convert(temp, kmerSize);
+ temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); }
+ m->setProcessors(temp);
+ convert(temp, processors);
+
temp = validParameter.validFile(parameters, "save", false); if (temp == "not found"){ temp = "f"; }
save = m->isTrue(temp);
//this is so the threads can quickly load the reference data
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
#else
- if (processors != 1) { save = true; }
+ if ((processors != 1) && (rdb->referenceSeqs.size() == 0)) { save = true; }
#endif
rdb->save = save;
if (save) { //clear out old references
}else if (taxonomyFileName == "not open") { abort = true; }
else { if (save) { rdb->setSavedTaxonomy(taxonomyFileName); } }
- temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); }
- m->setProcessors(temp);
- convert(temp, processors);
-
search = validParameter.validFile(parameters, "search", false); if (search == "not found"){ search = "kmer"; }
method = validParameter.validFile(parameters, "method", false); if (method == "not found"){ method = "bayesian"; }
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef diagbox_h\r
#define diagbox_h\r
\r
}\r
};\r
\r
-typedef const char *(*NWDIAG)(const byte *A, unsigned LA, const byte *B, unsigned LB,\r
- unsigned DiagLo, unsigned DiagHi, bool LeftTerm, bool RightTerm);\r
-\r
-const char *NWBandWrap(NWDIAG NW, const byte *A, unsigned LA, const byte *B, unsigned LB,\r
- unsigned DiagLo, unsigned DiagHi, bool LeftTerm, bool RightTerm);\r
+typedef const char *(*NWDIAG)(const byte *A, unsigned LA, const byte *B, unsigned LB,
+ unsigned DiagLo, unsigned DiagHi, bool LeftTerm, bool RightTerm);
+
+const char *NWBandWrap(NWDIAG NW, const byte *A, unsigned LA, const byte *B, unsigned LB,
+ unsigned DiagLo, unsigned DiagHi, bool LeftTerm, bool RightTerm);
\r
#endif // diagbox_h\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef dp_h\r
#define dp_h\r
\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef evalue_h\r
#define evalue_h\r
\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#include "myutils.h"\r
#include "alpha.h"\r
\r
if ((phylipfile == "") && (columnfile == "")) { //is there are current file available for either of these?
//give priority to column, then phylip
columnfile = m->getColumnFile();
- if (columnfile != "") { m->mothurOut("Using " + columnfile + " as input file for the column parameter."); m->mothurOutEndLine(); }
+ if (columnfile != "") { distFile = columnfile; format = "column"; m->mothurOut("Using " + columnfile + " as input file for the column parameter."); m->mothurOutEndLine(); }
else {
phylipfile = m->getPhylipFile();
- if (phylipfile != "") { m->mothurOut("Using " + phylipfile + " as input file for the phylip parameter."); m->mothurOutEndLine(); }
+ if (phylipfile != "") { distFile = phylipfile; format = "phylip"; m->mothurOut("Using " + phylipfile + " as input file for the phylip parameter."); m->mothurOutEndLine(); }
else {
m->mothurOut("No valid current files. You must provide a phylip or column file before you can use the get.oturep command."); m->mothurOutEndLine();
abort = true;
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#include "myutils.h"\r
#include "chime.h"\r
#include "ultra.h"\r
-//#if UCHIMES\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-#include "dp.h"\r
-#include "seq.h"\r
-\r
-static AlnParams g_AP;\r
-static bool g_APInitDone = false;\r
-\r
+#if UCHIMES
+
+#include "dp.h"
+#include "seq.h"
+
+static AlnParams g_AP;
+static bool g_APInitDone = false;
+
bool GlobalAlign(const SeqData &Query, const SeqData &Target, PathData &PD)\r
{\r
if (!g_APInitDone)\r
return true;\r
}\r
\r
-//#endif // UCHIMES\r
+#endif // UCHIMES\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.
-
"\n"
"Usage\n"
"-----\n"
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef hsp_h\r
#define hsp_h 1\r
\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.
-
#ifndef hspfinder_h
#define hspfinder_h
if (m->control_pressed) { in.close(); return 0; }
- while (binnames.find_first_of(',') != -1) {
- string name = binnames.substr(0,binnames.find_first_of(','));
- binnames = binnames.substr(binnames.find_first_of(',')+1, binnames.length());
- names.push_back(name);
- }
-
- names.push_back(binnames);
+ m->splitAtComma(binnames, names);
}
}
in.close();
in >> secondCol;
//parse second column saving each name
- while (secondCol.find_first_of(',') != -1) {
- name = secondCol.substr(0,secondCol.find_first_of(','));
- secondCol = secondCol.substr(secondCol.find_first_of(',')+1, secondCol.length());
- names.push_back(name);
- }
-
- //get name after last ,
- names.push_back(secondCol);
+ m->splitAtComma(secondCol, names);
m->gobble(in);
}
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#include "myutils.h"\r
#include "sfasta.h"\r
#include "path.h"\r
USEREADLINE ?= yes
CYGWIN_BUILD ?= no
USECOMPRESSION ?= no
-MOTHUR_FILES="\"/Users/Sarahswork/desktop/release\""
-RELEASE_DATE = "\"7/25/2011\""
-VERSION = "\"1.21.0\""
+MOTHUR_FILES="\"Enter_your_default_path_here\""
+RELEASE_DATE = "\"10/18/2011\""
+VERSION = "\"1.22.0\""
# Optimize to level 3:
-CXXFLAGS += -03 -g
+CXXFLAGS += -O3
ifeq ($(strip $(64BIT_VERSION)),yes)
#if you are using centos uncomment the following lines
OBJECTS=$(patsubst %.cpp,%.o,$(wildcard *.cpp))
OBJECTS+=$(patsubst %.c,%.o,$(wildcard *.c))
-mothur : $(OBJECTS)
+mothur : $(OBJECTS) uchime
$(CXX) $(LDFLAGS) $(TARGET_ARCH) -o $@ $(OBJECTS) $(LIBS)
strip mothur
+uchime:
+ cd uchime_src && ./mk && mv uchime .. && cd ..
+
install : mothur
# cp mothur ../Release/mothur
clean :
@rm -f $(OBJECTS)
+ @rm -f uchime
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#include "myutils.h"\r
#include "mx.h"\r
#include "seqdb.h"\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef mx_h\r
#define mx_h\r
\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef MY_VERSION\r
#define MY_VERSION "4.2"\r
#endif\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#include <time.h>\r
#include <stdarg.h>\r
#include <sys/stat.h>\r
#include <signal.h>\r
#include <float.h>\r
\r
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)\r
+#ifdef _MSC_VER\r
+#include <crtdbg.h>\r
+#include <process.h>\r
+#include <windows.h>\r
+#include <psapi.h>\r
+#include <io.h>\r
+#else\r
#include <sys/time.h>\r
#include <sys/resource.h>\r
#include <unistd.h>\r
#include <errno.h>\r
#include <fcntl.h>\r
#include <stdlib.h>\r
-#else\r
-//#include <crtdbg.h>\r
-#include <process.h>\r
-#include <windows.h>\r
-#include <psapi.h>\r
-#include <io.h>\r
#endif\r
\r
#include "myutils.h"\r
return isatty(fd) != 0;\r
}\r
\r
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)\r
-#else\r
-//#ifdef BIT_VERSION\r
-//#include <io.h>\r
-//int fseeko(FILE *stream, off_t offset, int whence)\r
-//// {\r
-// off_t FilePos = _fseeki64(stream, offset, whence);\r
-// return (FilePos == -1L) ? -1 : 0;\r
-// }\r
-//#define ftello(fm) (off_t) _ftelli64(fm)\r
-//#else \r
+#ifdef _MSC_VER\r
+#include <io.h>\r
int fseeko(FILE *stream, off_t offset, int whence)\r
-{\r
- off_t FilePos = fseek(stream, offset, whence);\r
+ {\r
+ off_t FilePos = _fseeki64(stream, offset, whence);\r
return (FilePos == -1L) ? -1 : 0;\r
-}\r
-#define ftello(fm) (off_t) ftell(fm)\r
-//#endif\r
+ }\r
+#define ftello(fm) (off_t) _ftelli64(fm)\r
#endif\r
\r
void LogStdioFileState(FILE *f)\r
Log("fpos %ld (retval %d)\n", (long) fpos, fgetpos_retval);\r
// Log("eof %d\n", _eof(fd));\r
#endif\r
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)\r
-#else\r
-#ifdef BIT_VERSION\r
+#ifdef _MSC_VER\r
__int64 pos64 = _ftelli64(f);\r
Log("_ftelli64 %lld\n", pos64);\r
-#else\r
- __int32 pos32 = ftell(f);\r
- Log("ftell %lld\n", pos32);\r
- \r
-#endif\r
#endif\r
}\r
\r
off_t GetStdioFileSize(FILE *f)\r
{\r
off_t CurrentPos = GetStdioFilePos(f);\r
- off_t zeroPos = 0;\r
- int Ok = fseeko(f, zeroPos, SEEK_END);\r
+ int Ok = fseeko(f, 0, SEEK_END);\r
if (Ok < 0)\r
Die("fseek in GetFileSize");\r
\r
fprintf(stderr, "\n---Fatal error---\n%s\n", szStr);\r
Log("\n---Fatal error---\n%s\n", szStr);\r
\r
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)\r
-#else\r
- //if (IsDebuggerPresent())\r
- // __debugbreak();\r
- //_CrtSetDbgFlag(0);\r
+#ifdef _MSC_VER\r
+ if (IsDebuggerPresent())\r
+ __debugbreak();\r
+ _CrtSetDbgFlag(0);\r
#endif\r
\r
exit(1);\r
}\r
}\r
\r
-#if defined linux || __linux__\r
+#ifdef _MSC_VER\r
+double GetMemUseBytes()\r
+ {\r
+ HANDLE hProc = GetCurrentProcess();\r
+ PROCESS_MEMORY_COUNTERS PMC;\r
+ BOOL bOk = GetProcessMemoryInfo(hProc, &PMC, sizeof(PMC));\r
+ if (!bOk)\r
+ return 1000000;\r
+ double Bytes = (double) PMC.WorkingSetSize;\r
+ if (Bytes > g_PeakMemUseBytes)\r
+ g_PeakMemUseBytes = Bytes;\r
+ return Bytes;\r
+ }\r
+#elif linux || __linux__\r
double GetMemUseBytes()\r
{\r
static char statm[64];\r
g_PeakMemUseBytes = Bytes;\r
return Bytes;\r
}\r
-#elif defined(__APPLE__) || (__MACH__)\r
+#elif defined(__MACH__)\r
#include <memory.h>\r
#include <stdlib.h>\r
#include <stdio.h>\r
}\r
#else\r
double GetMemUseBytes()\r
-{\r
+ {\r
return 0;\r
-}\r
+ }\r
#endif\r
\r
double GetPeakMemUseBytes()\r
// Skip exit(), which can be very slow in DEBUG build\r
// VERY DANGEROUS practice, because it skips global destructors.\r
// But if you know the rules, you can break 'em, right?\r
- //ExitProcess(0);\r
+ ExitProcess(0);\r
#endif\r
}\r
\r
g_Opts.insert(Opt);\r
}\r
\r
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)\r
-#else\r
+#ifdef _MSC_VER\r
#pragma warning(disable: 4505) // unreferenced local function\r
#endif\r
\r
\r
void MyCmdLine(int argc, char **argv)\r
{\r
- g_Opts.clear(); g_Argv.clear();\r
static unsigned RecurseDepth = 0;\r
++RecurseDepth;\r
\r
if (RecurseDepth == 0)\r
g_Argv.clear();\r
\r
- for (int i = 0; i < argc; ++i) \r
+ for (int i = 0; i < argc; ++i) {\r
g_Argv.push_back(string(argv[i]));\r
- \r
+ }\r
\r
int i = 1;\r
for (;;)\r
if (i >= argc)\r
break;\r
const string &Arg = g_Argv[i];\r
- \r
+ \r
if (Arg.empty())\r
continue;\r
else if (Arg == "file:" && i + 1 < argc)\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef myutils_h\r
#define myutils_h\r
\r
#define RCE_MALLOC 0\r
-\r
+
#include <stdio.h>\r
#include <sys/types.h>\r
#include <string>\r
#include <cstdlib>\r
#include <climits>\r
\r
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)\r
-#else\r
+#ifndef _MSC_VER\r
#include <inttypes.h>\r
#endif\r
\r
using namespace std;\r
\r
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)\r
-#else\r
-//#include <crtdbg.h>\r
+#ifdef _MSC_VER\r
+#include <crtdbg.h>\r
#pragma warning(disable: 4996) // deprecated functions\r
#define _CRT_SECURE_NO_DEPRECATE 1\r
#endif\r
\r
-//#if defined(_DEBUG) && !defined(DEBUG)\r
+#if defined(_DEBUG) && !defined(DEBUG)\r
#define DEBUG 1\r
-//#endif\r
+#endif\r
\r
-//#if defined(DEBUG) && !defined(_DEBUG)\r
+#if defined(DEBUG) && !defined(_DEBUG)\r
#define _DEBUG 1\r
-//#endif\r
+#endif\r
\r
-//#ifndef NDEBUG\r
+#ifndef NDEBUG\r
#define DEBUG 1\r
#define _DEBUG 1\r
-//#endif\r
+#endif\r
\r
typedef unsigned char byte;\r
typedef unsigned short uint16;\r
typedef signed char int8;\r
typedef unsigned char uint8;\r
\r
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)\r
+#ifdef _MSC_VER\r
\r
-typedef long long int64;\r
-typedef unsigned long long uint64;\r
+typedef __int64 int64;\r
+typedef unsigned __int64 uint64;\r
\r
#define INT64_PRINTF "lld"\r
#define UINT64_PRINTF "llu"\r
#define SIZE_T_PRINTFX "x"\r
#define OFF64_T_PRINTFX "llx"\r
\r
-\r
#elif defined(__x86_64__)\r
\r
typedef long int64;\r
\r
#else\r
\r
-typedef __int64 int64;\r
-typedef unsigned __int64 uint64;\r
+typedef long long int64;\r
+typedef unsigned long long uint64;\r
\r
#define INT64_PRINTF "lld"\r
#define UINT64_PRINTF "llu"\r
\r
#define SIZE_T_PRINTFX "x"\r
#define OFF64_T_PRINTFX "llx"\r
-\r
#endif\r
\r
#define d64 INT64_PRINTF\r
\r
bool myisatty(int fd);\r
\r
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)\r
-#else\r
+#ifdef _MSC_VER\r
#define off_t __int64\r
#endif\r
\r
\r
extern const char *SVN_VERSION;\r
extern const char *SVN_MODS;\r
-extern bool opt_quiet;\r
-extern bool opt_version;\r
-extern FILE *g_fLog;\r
+extern bool opt_quiet;
+extern bool opt_version;
+extern FILE *g_fLog;
\r
#endif // myutils_h\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef orf_h\r
#define orf_h\r
\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef out_h\r
#define out_h\r
\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#include "myutils.h"\r
#include "path.h"\r
#include "timing.h"\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef path_h\r
#define path_h\r
\r
//find out the sequences group
string group = groupmap->getGroup(seqName);
- if (group == "not found") { m->mothurOut(seqName + " is not in your groupfile, and will be included in the overall total, but not any group total."); m->mothurOutEndLine(); }
+ if (group == "not found") { m->mothurOut("[WARNING]: " + seqName + " is not in your groupfile, and will be included in the overall total, but not any group total."); m->mothurOutEndLine(); }
//do you have a count for this group?
map<string, int>::iterator itGroup = tree[childPointer->second].groupCount.find(group);
//find out the sequences group
string group = groupmap->getGroup(seqName);
- if (group == "not found") { m->mothurOut(seqName + " is not in your groupfile, and will be included in the overall total, but not any group total."); m->mothurOutEndLine(); }
+ if (group == "not found") { m->mothurOut("[WARNING]: " + seqName + " is not in your groupfile, and will be included in the overall total, but not any group total."); m->mothurOutEndLine(); }
//do you have a count for this group?
map<string, int>::iterator itGroup = tree[index].groupCount.find(group);
//find out the sequences group
string group = groupmap->getGroup(names[k]);
- if (group == "not found") { m->mothurOut(names[k] + " is not in your groupfile, and will be included in the overall total, but not any group total."); m->mothurOutEndLine(); }
+ if (group == "not found") { m->mothurOut("[WARNING]: " + names[k] + " is not in your groupfile, and will be included in the overall total, but not any group total."); m->mothurOutEndLine(); }
else {
containsGroup[group] = true;
}
//find out the sequences group
string group = groupmap->getGroup(names[k]);
- if (group == "not found") { m->mothurOut(names[k] + " is not in your groupfile, and will be included in the overall total, but not any group total."); m->mothurOutEndLine(); }
+ if (group == "not found") { m->mothurOut("[WARNING]: " + names[k] + " is not in your groupfile, and will be included in the overall total, but not any group total."); m->mothurOutEndLine(); }
else {
containsGroup[group] = true;
}
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#include "myutils.h"\r
#include "ultra.h"\r
#include "chime.h"\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef seq_h\r
#define seq_h\r
\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#include "myutils.h"\r
#include "seqdb.h"\r
#include "alpha.h"\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef seqdb_h\r
#define seqdb_h\r
\r
#include <vector>\r
#include <map>\r
-#include "myutils.h"\r
\r
struct SeqData;\r
\r
*
*/
-#include "sequenceParser.h"
+#include "sequenceparser.h"
/************************************************************/
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
-#include "myutils.h"\r
-#include "mx.h"\r
-\r
-Mx<float> g_SubstMxf;\r
-float **g_SubstMx;\r
-\r
-static const char Alphabet[] = "ACGTU";\r
-\r
+#include "myutils.h"
+#include "mx.h"
+
+Mx<float> g_SubstMxf;
+float **g_SubstMx;
+
+static const char Alphabet[] = "ACGTU";
+
void SetNucSubstMx(double Match, double Mismatch)\r
{\r
static bool Done = false;\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#include "sfasta.h"\r
#include "orf.h"\r
#include "alpha.h"\r
if (!WarningDone)\r
{\r
if (isgap(c))\r
- //Warning("Ignoring gaps in FASTA file '%s'",\r
- //m_FileName.c_str());\r
- ;\r
+ Warning("Ignoring gaps in FASTA file '%s'",\r
+ m_FileName.c_str());\r
else if (isprint(c))\r
Warning("Invalid FASTA file '%s', non-letter '%c' in sequence >%s",\r
m_FileName.c_str(), c, Label);\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef sfasta_h\r
#define sfasta_h\r
\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.
-
#define TIMING 0
#ifndef timing_h
#define timing_h
#define BG_TIMING 0
#endif
-//#if UCHIMES
+#if UCHIMES
#undef TIMING
#define TIMING 0
-//#endif
+#endif
#if TIMING
#undef A
;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
-typedef uint64_t TICKS;
-__inline__ uint64_t GetClockTicks()
-{
- uint32_t lo, hi;
- /* We cannot use "=A", since this would use %rax on x86_64 */
- __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi));
- return (uint64_t)hi << 32 | lo;
-}
-
+#ifdef _MSC_VER
-#else // ifdef _MSC_VER
typedef unsigned __int64 TICKS;
#pragma warning(disable:4035)
inline TICKS GetClockTicks()
-{
- _asm
{
+ _asm
+ {
_emit 0x0f
_emit 0x31
+ }
+ }
+
+#else // ifdef _MSC_VER
+
+typedef uint64_t TICKS;
+__inline__ uint64_t GetClockTicks()
+ {
+ uint32_t lo, hi;
+ /* We cannot use "=A", since this would use %rax on x86_64 */
+ __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi));
+ return (uint64_t)hi << 32 | lo;
}
-}
#endif // ifdef _MSC_VER
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.
-
#include "dp.h"
#define TRACE 0
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef uc_h\r
#define uc_h\r
\r
\r
struct AlnData;\r
\r
-int uchime_main(int, char**); \r
+int uchime_main(int, char**); \r
\r
class UCFile\r
{\r
vector<unsigned> m_SeedLos;\r
\r
public:\r
- /* some function prototypes */\r
- \r
- \r
UCFile();\r
void Clear(bool ctor = false);\r
void Close();\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#include "myutils.h"\r
#include "chime.h"\r
#include "seqdb.h"\r
#include "hspfinder.h"\r
#include <algorithm>\r
#include <set>\r
-#include "mothurout.h"\r
\r
bool SearchChime(Ultra &U, const SeqData &QSD, float QAb, \r
const AlnParams &AP, const AlnHeuristics &AH, HSPFinder &HF,\r
\r
void Usage()\r
{\r
- //printf("\n");\r
- //printf("UCHIME %s by Robert C. Edgar\n", MY_VERSION);\r
- //printf("http://www.drive5.com/uchime\n");\r
- //printf("\n");\r
- //printf("This software is donated to the public domain\n");\r
- //printf("\n");\r
-\r
- //printf(\r
-//#include "help.h"\r
- //);\r
+ printf("\n");\r
+ printf("UCHIME %s by Robert C. Edgar\n", MY_VERSION);\r
+ printf("http://www.drive5.com/uchime\n");\r
+ printf("\n");\r
+ printf("This software is donated to the public domain\n");\r
+ printf("\n");\r
+\r
+ printf(\r
+#include "help.h"\r
+ );\r
}\r
\r
void SetBLOSUM62()\r
\r
int uchime_main(int argc, char *argv[])\r
{\r
- MothurOut* m;\r
- m = MothurOut::getInstance();\r
\r
MyCmdLine(argc, argv);\r
\r
return 0;\r
}\r
\r
- \r
+ printf("uchime v" MY_VERSION ".%s\n", SVN_VERSION);\r
+ printf("by Robert C. Edgar\n");\r
+ printf("http://drive5.com/uchime\n");\r
+ printf("This code is donated to the public domain.\n");\r
+ printf("\n");\r
if (!optset_w)\r
opt_w = 8;\r
\r
unsigned HitCount = 0;\r
for (unsigned i = 0; i < QuerySeqCount; ++i)\r
{\r
- \r
- if (m->control_pressed) { break; }\r
- \r
unsigned QuerySeqIndex = Order[i];\r
\r
SeqData QSD;\r
\r
WriteChimeHit(g_fUChime, Hit);\r
\r
- //ProgressStep(i, QuerySeqCount, "%u/%u chimeras found (%.1f%%)", HitCount, i, Pct(HitCount, i+1));\r
- //report progress\r
- if((i+1) % 100 == 0){ m->mothurOut("Processing sequence: " + toString(i+1) + ", " + toString(HitCount) + " chimeras found."); m->mothurOutEndLine(); }\r
- }\r
- if (!m->control_pressed) { \r
- //report progress\r
- if((QuerySeqCount) % 100 != 0){ m->mothurOut("Processing sequence: " + toString(QuerySeqCount) + ", " + toString(HitCount) + " chimeras found."); m->mothurOutEndLine(); }\r
+ ProgressStep(i, QuerySeqCount, "%u/%u chimeras found (%.1f%%)", HitCount, i, Pct(HitCount, i+1));\r
}\r
\r
Log("\n");\r
m->openOutputFile(sumFile, outSum);
util = new SharedUtil();
- vector<string> Groups = m->getGroups();
+ Groups = m->getGroups();
vector<string> namesGroups = tmap->getNamesOfGroups();
util->setGroups(Groups, namesGroups, allGroups, numGroups, "unweighted"); //sets the groups the user wants to analyze
util->getCombos(groupComb, Groups, numComp);
+ m->setGroups(Groups);
delete util;
if (numGroups == 1) { numComp++; groupComb.push_back(allGroups); }
util = new SharedUtil();
string s; //to make work with setgroups
- vector<string> Groups = m->getGroups();
+ Groups = m->getGroups();
vector<string> nameGroups = tmap->getNamesOfGroups();
util->setGroups(Groups, nameGroups, s, numGroups, "weighted"); //sets the groups the user wants to analyze
util->getCombos(groupComb, Groups, numComp);
+ m->setGroups(Groups);
delete util;
weighted = new Weighted(tmap, includeRoot);
-//#if UCHIMES\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
+#if UCHIMES\r
+\r
#include "myutils.h"\r
#include "seqdb.h"\r
#include "seq.h"\r
SortDescending(WordCounts, Order);\r
}\r
\r
-//#endif // UCHIMES\r
+#endif // UCHIMES\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.
-
#include "dp.h"
#include "out.h"
#include "evalue.h"
#define CMP_SIMPLE 0
-
+\r
#if SAVE_FAST
static Mx<float> g_MxDPM;
static Mx<float> g_MxDPD;
g_DPDSimple = g_DPDSimpleMx->GetData();
g_DPISimple = g_DPISimpleMx->GetData();
#endif
- g_MxDPM.Alloc("FastM", LA+1, LB+1);
- g_MxDPD.Alloc("FastD", LA+1, LB+1);
- g_MxDPI.Alloc("FastI", LA+1, LB+1);
-
- g_MxTBM.Alloc("FastTBM", LA+1, LB+1);
- g_MxTBD.Alloc("FastTBD", LA+1, LB+1);
- g_MxTBI.Alloc("FastTBI", LA+1, LB+1);
-
- g_DPM = g_MxDPM.GetData();
- g_DPD = g_MxDPD.GetData();
- g_DPI = g_MxDPI.GetData();
-
- g_TBM = g_MxTBM.GetData();
- g_TBD = g_MxTBD.GetData();
- g_TBI = g_MxTBI.GetData();
+ g_MxDPM.Alloc("FastM", LA+1, LB+1);\r
+ g_MxDPD.Alloc("FastD", LA+1, LB+1);\r
+ g_MxDPI.Alloc("FastI", LA+1, LB+1);\r
+\r
+ g_MxTBM.Alloc("FastTBM", LA+1, LB+1);\r
+ g_MxTBD.Alloc("FastTBD", LA+1, LB+1);\r
+ g_MxTBI.Alloc("FastTBI", LA+1, LB+1);\r
+\r
+ g_DPM = g_MxDPM.GetData();\r
+ g_DPD = g_MxDPD.GetData();\r
+ g_DPI = g_MxDPI.GetData();\r
+\r
+ g_TBM = g_MxTBM.GetData();\r
+ g_TBD = g_MxTBD.GetData();\r
+ g_TBI = g_MxTBI.GetData();\r
}
static void SAVE_DPM(unsigned i, unsigned j, float x)
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#ifndef windex_h\r
#define windex_h\r
\r
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
-\r
#include "myutils.h"\r
#include "chime.h"\r
\r