]> git.donarmstrong.com Git - mothur.git/commitdiff
1.22.0
authorwestcott <westcott>
Tue, 18 Oct 2011 15:52:07 +0000 (15:52 +0000)
committerwestcott <westcott>
Tue, 18 Oct 2011 15:52:07 +0000 (15:52 +0000)
58 files changed:
Mothur.xcodeproj/project.pbxproj
addtargets2.cpp
alignchime.cpp
alignchimel.cpp
alnheuristics.h
alnparams.cpp
alnparams.h
alpha.cpp
alpha.h
alpha2.cpp
chainer.h
chime.h
chimeraslayer.cpp
chimeraslayercommand.cpp
chimeraslayercommand.h
chimerauchimecommand.cpp
classifyseqscommand.cpp
diagbox.h
dp.h
evalue.h
fractid.cpp
getoturepcommand.cpp
getparents.cpp
globalalign2.cpp
help.h
hsp.h
hspfinder.h
listseqscommand.cpp
make3way.cpp
makefile
mx.cpp
mx.h
myopts.h
myutils.cpp
myutils.h
orf.h
out.h
path.cpp
path.h
phylosummary.cpp
searchchime.cpp
seq.h
seqdb.cpp
seqdb.h
sequenceparser.cpp
setnucmx.cpp
sfasta.cpp
sfasta.h
timing.h
tracebackbit.cpp
uc.h
uchime_main.cpp
unifracunweightedcommand.cpp
unifracweightedcommand.cpp
usort.cpp
viterbifast.cpp
windex.h
writechhit.cpp

index 769e33999b25da3d3751b2249476e7c53fab7a6a..2da1ed5721dac55e0f44c9a856d0dbfded11e094 100644 (file)
                                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;
index 57a4ef58b1b77b586ff104c5f62c25f0bd901941..f3f637755027799ae9c2a2971dfaa24bb81b56e4 100644 (file)
@@ -1,5 +1,5 @@
-//#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
@@ -35,4 +35,4 @@ void AddTargets(SeqDB &DB, const SeqData &Query, set<unsigned> &TargetIndexes)
                }\r
        }\r
 \r
-//#endif\r
+#endif\r
index c97c333ce42ad6d50fcdca96cb2758c30dc8d213..d7b05a877f2e2e09746d4ed02864fb0884349613 100644 (file)
@@ -1,5 +1,3 @@
-//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
index 8f4cbd57bd1cda8e29e8f1cbdde32292643aeb5d..ae152af8dea0d02ff298b367756971468d0ca078 100644 (file)
@@ -1,5 +1,3 @@
-//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
index cd346cf1201d5ac6e265da145f99476a1168b82d..9a8d283ed4f710b8951a2d72faf7ce9f39450e83 100644 (file)
@@ -1,5 +1,3 @@
-//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
index 41ee738027921b1a217544a67a449ff0dc5fb761..d1b90364212dc4aa41bd275166e22cf37afc2038 100644 (file)
@@ -1,5 +1,3 @@
-//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
@@ -8,12 +6,12 @@
 \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
@@ -315,14 +313,14 @@ void AlnParams::SetPenalties(const string &OpenStr, const string &ExtStr)
 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
@@ -363,9 +361,9 @@ void AlnParams::InitFromCmdLine(bool IsNucleo)
 \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
index b159179098426ae1eaac9ab11c20251b15c9e0dc..4037912566144aff0ce326609029004395a15a6f 100644 (file)
@@ -1,5 +1,3 @@
-//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
index 9d82f350eb7d8045d59f1005af13057a5ec1a3ac..0efca3ba0bc09a61c0ad980948a7f9c49761a3f7 100644 (file)
--- a/alpha.cpp
+++ b/alpha.cpp
@@ -1,5 +1,4 @@
 // 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] =
diff --git a/alpha.h b/alpha.h
index e491c9c602ffe0186f0d3b2aec6d514d87832b05..e021b7fbc307ea1277a26d4a86275415cc167754 100644 (file)
--- a/alpha.h
+++ b/alpha.h
@@ -1,5 +1,3 @@
-//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
index 08f6e21cefab25906fa8b54a0afa330099a6079c..26bc1c6bac30ae7c3c024d74eb0fb97d55477397 100644 (file)
@@ -1,5 +1,3 @@
-//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
index 7f541311e721e6778fd3b5312266fd3578fa5d42..a954dc04b326b54d5ce2f83f027f492b3f4dd73a 100644 (file)
--- a/chainer.h
+++ b/chainer.h
@@ -1,5 +1,3 @@
-//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
diff --git a/chime.h b/chime.h
index f143ea10795df3ed995660b0862bb0142f2db91b..1b0662a6ef39fe1eadd98bdf46fc4fa1abb8b3ce 100644 (file)
--- a/chime.h
+++ b/chime.h
@@ -1,5 +1,3 @@
-//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
index b637000fe688920ac89097358cc50e9ac5ca2fc8..458e89d075f0f6044158cfcc6b1b9daee24fc2f7 100644 (file)
@@ -76,7 +76,7 @@ ChimeraSlayer::ChimeraSlayer(string file, string temp, bool trim, map<string, in
                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++) {  
@@ -382,7 +382,7 @@ Sequence ChimeraSlayer::print(ostream& out, ostream& outAcc) {
                        
                        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()); }
index 629eca965b3ca1c084c3d837b6a2870ea8fa43ec..f15581f271382f671505dc708a9ffa2545e32eeb 100644 (file)
@@ -532,6 +532,11 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option)  {
                        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) {
@@ -561,7 +566,6 @@ int ChimeraSlayerCommand::execute(){
                        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;
@@ -582,11 +586,15 @@ int ChimeraSlayerCommand::execute(){
                                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];
@@ -978,7 +986,7 @@ int ChimeraSlayerCommand::deconvoluteResults(SequenceParser* parser, string outp
                                        
                                        if (print) {
                                                out << name << '\t';
-                                               cout << name<< endl;
+                                               
                                                namesInFile.insert(name);
 
                                                //output parent1's name
@@ -1406,7 +1414,7 @@ int ChimeraSlayerCommand::createProcesses(string outputFileName, string filename
                        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]);   
                }
index 9a37a5ba3941a11d79c0b00ee387a3c2db2b2628..815cb367c70dd844013fa9d53ca42800887342f6 100644 (file)
@@ -54,7 +54,7 @@ private:
        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
index c035b01d689657c233126b5748b303a04a997356..2b24fd8ed7ccc3fba78fa08d25c6c77a67506229 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "chimerauchimecommand.h"
 #include "deconvolutecommand.h"
-#include "uc.h"
+//#include "uc.h"
 #include "sequence.hpp"
 #include "referencedb.h"
 
@@ -453,7 +453,25 @@ ChimeraUchimeCommand::ChimeraUchimeCommand(string option)  {
                        
                        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) {
@@ -964,11 +982,23 @@ int ChimeraUchimeCommand::driverGroups(SequenceParser& parser, string outputFNam
 
 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]; 
@@ -1190,15 +1220,23 @@ int ChimeraUchimeCommand::driver(string outputFName, string filename, string acc
                
                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
index 3b7b4a8c595cfeb9d6149a05a2b5347e6adfe6cc..af6d91449065af894f086c497cfcbc171f374098 100644 (file)
@@ -376,12 +376,16 @@ ClassifySeqsCommand::ClassifySeqsCommand(string option)  {
                        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
@@ -416,10 +420,6 @@ ClassifySeqsCommand::ClassifySeqsCommand(string option)  {
                        }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";    }
index 2491a58accce9c691c21f471af5eccda75354c81..0c5846ce28e510509266238eb0ac4ce7151e483f 100644 (file)
--- a/diagbox.h
+++ b/diagbox.h
@@ -1,5 +1,3 @@
-//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
@@ -186,10 +184,10 @@ Don't have proof..
                }\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
diff --git a/dp.h b/dp.h
index d8581fbc6fbc6e91be56acb3b59dd52af1df64d2..c771538a32c648f8bc6f195a368fb58a14385124 100644 (file)
--- a/dp.h
+++ b/dp.h
@@ -1,5 +1,3 @@
-//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
index fe324f840f1da9b3886186068d26375bb53873a9..c9308dbf4a1f7f89db5036f7e0e36bbd25f852cb 100644 (file)
--- a/evalue.h
+++ b/evalue.h
@@ -1,5 +1,3 @@
-//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
index ad4c1579c43c1b75d41583e700fdf4ac85cc49e9..f2988771cac56bbaeda7e68d8be866a3e7f666b2 100644 (file)
@@ -1,5 +1,3 @@
-//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
index 378e9186a70b46f8a8c8821b77e3c213b2859990..9742bcbd3b0ea952e3a5b5b54428bee701c5191f 100644 (file)
@@ -232,10 +232,10 @@ GetOTURepCommand::GetOTURepCommand(string option)  {
                        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;
index 26a2cd1099cf8dc8b6a51891a59a99ea9a916fd7..d82f9028b25f1ff9c37f8ec100970df5d687c511 100644 (file)
@@ -1,5 +1,3 @@
-//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
index 10f8032f02deb7b300eba638ccf3e155dc21d2b2..2adfb719ba21f0d33227eaad6d61e6b6452f0e70 100644 (file)
@@ -1,11 +1,11 @@
-//#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
@@ -42,4 +42,4 @@ bool GlobalAlign(const SeqData &Query, const SeqData &Target, const AlnParams &/
        return true;\r
        }\r
 \r
-//#endif // UCHIMES\r
+#endif // UCHIMES\r
diff --git a/help.h b/help.h
index 1534cd171551736a145bbe33da893ac6bdd91fc5..9d7a89f114d00d1e68fc74c75a6f50a585c141a2 100644 (file)
--- a/help.h
+++ b/help.h
@@ -1,5 +1,3 @@
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.
-
 "\n"
 "Usage\n"
 "-----\n"
diff --git a/hsp.h b/hsp.h
index 7f003bf1a085733d35fe9ac251e4c350a6af7ee4..339256f20efc395b50d3f28f31a5f5302337eaf6 100644 (file)
--- a/hsp.h
+++ b/hsp.h
@@ -1,5 +1,3 @@
-//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
index dc287e991502f16c83fa7d678011eeaf4d9426d1..2b8e9d84cac56d05d891beb9db9bdbf984a8bef5 100644 (file)
@@ -1,5 +1,3 @@
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.
-
 #ifndef hspfinder_h
 #define hspfinder_h
 
index ef1515863dbca8b0f930d1b26f3c9f2936c7eec4..833ac952a8db761b16ba59d9b53b561bef07ad0b 100644 (file)
@@ -313,13 +313,7 @@ int ListSeqsCommand::readList(){
                                
                                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();     
@@ -349,14 +343,7 @@ int ListSeqsCommand::readName(){
                        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);
                }
index dbadd1ab26269b10ee98229c638582ea8774b30b..ce88f8616bd21f2362e3706d58c9b7917928bf00 100644 (file)
@@ -1,5 +1,3 @@
-//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
index 3f6431210735a622f8c0e416a088581d331ed714..35857e0cba8b408610f7d230d150b34bfb6915a0 100644 (file)
--- a/makefile
+++ b/makefile
@@ -14,12 +14,12 @@ USEMPI ?= no
 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
@@ -90,11 +90,14 @@ endif
 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
        
@@ -108,4 +111,5 @@ install : mothur
 
 clean :
        @rm -f $(OBJECTS)
+       @rm -f uchime
 
diff --git a/mx.cpp b/mx.cpp
index 9e61d1beb368b75eb447f6f3159cfa4cecb74c25..48c347e5832c461750cf72bd7b0a483013f7d57c 100644 (file)
--- a/mx.cpp
+++ b/mx.cpp
@@ -1,5 +1,3 @@
-//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
diff --git a/mx.h b/mx.h
index 24629377ed662bb9291704087243cbd95e9eef2e..143890086d59bb8d0f1d7f35d62cdd7dae3da1d0 100644 (file)
--- a/mx.h
+++ b/mx.h
@@ -1,5 +1,3 @@
-//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
index 812dd8baed5386990ba4160048ac98d2e783af1a..ba901ea48e38ad5b9f59b85dc7be43e208e70a4b 100644 (file)
--- a/myopts.h
+++ b/myopts.h
@@ -1,5 +1,3 @@
-//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
index 78bf5439091ade28ce3337094deda7fc91779c3b..6e10a85ce27e6b6448b8416060b1b151a48428f9 100755 (executable)
@@ -1,5 +1,3 @@
-//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
@@ -141,24 +139,14 @@ bool myisatty(int fd)
        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
@@ -178,16 +166,9 @@ void LogStdioFileState(FILE *f)
        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
@@ -513,8 +494,7 @@ off_t GetStdioFilePos(FILE *f)
 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
@@ -614,11 +594,10 @@ void Die(const char *Format, ...)
        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
@@ -643,7 +622,20 @@ void Warning(const char *Format, ...)
                }\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
@@ -674,7 +666,7 @@ double GetMemUseBytes()
                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
@@ -715,9 +707,9 @@ double GetMemUseBytes()
        }\r
 #else\r
 double GetMemUseBytes()\r
-{\r
+       {\r
        return 0;\r
-}\r
+       }\r
 #endif\r
 \r
 double GetPeakMemUseBytes()\r
@@ -955,7 +947,7 @@ void ProgressExit()
 // 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
@@ -1207,8 +1199,7 @@ static void AddOpt(const OptInfo &Opt)
        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
@@ -1532,7 +1523,6 @@ static void GetArgsFromFile(const string &FileName, vector<string> &Args)
 \r
 void MyCmdLine(int argc, char **argv)\r
        {\r
-       g_Opts.clear(); g_Argv.clear();\r
        static unsigned RecurseDepth = 0;\r
        ++RecurseDepth;\r
 \r
@@ -1563,9 +1553,9 @@ void MyCmdLine(int argc, char **argv)
        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
@@ -1573,7 +1563,7 @@ void MyCmdLine(int argc, char **argv)
                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
index 6374c8bee360033277aba81f73e836ef9a86cc13..b63ad3cff91af09741a5d53865916f9781a53973 100644 (file)
--- a/myutils.h
+++ b/myutils.h
@@ -1,10 +1,8 @@
-//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
@@ -51,10 +47,10 @@ typedef double float32;
 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
@@ -68,7 +64,6 @@ typedef unsigned long long uint64;
 #define SIZE_T_PRINTFX         "x"\r
 #define OFF64_T_PRINTFX                "llx"\r
 \r
-\r
 #elif defined(__x86_64__)\r
 \r
 typedef long int64;\r
@@ -88,8 +83,8 @@ typedef unsigned long uint64;
 \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
@@ -102,7 +97,6 @@ typedef unsigned __int64 uint64;
 \r
 #define SIZE_T_PRINTFX         "x"\r
 #define OFF64_T_PRINTFX                "llx"\r
-\r
 #endif\r
 \r
 #define d64            INT64_PRINTF\r
@@ -164,8 +158,7 @@ void myfree(void *p);
 \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
@@ -274,8 +267,8 @@ void GetCmdLine(string &s);
 \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
diff --git a/orf.h b/orf.h
index 06f73a1f9a733d3c0a6b0f3cdea5fc414f9b3cd4..90b29d1441589b41e7f64525134a80e0364e820b 100644 (file)
--- a/orf.h
+++ b/orf.h
@@ -1,5 +1,3 @@
-//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
diff --git a/out.h b/out.h
index 595e08c889849aba8ad25501b3bff742ff14f855..4ca50c7c3d3d0937a0b94b63b1fe0ea93082b6d0 100644 (file)
--- a/out.h
+++ b/out.h
@@ -1,5 +1,3 @@
-//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
index 555830a9397eefa47fc52a9b1c590d7d50676ab4..93403444ce9c0ce9780d896682ddde00ccc0bfdc 100644 (file)
--- a/path.cpp
+++ b/path.cpp
@@ -1,5 +1,3 @@
-//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
diff --git a/path.h b/path.h
index b04ab74424691407f6a46a48588384ee630404a3..f63be7ee109391164451d4397c16ab4715749ad3 100644 (file)
--- a/path.h
+++ b/path.h
@@ -1,5 +1,3 @@
-//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
index 47591f6a8ec577afe99fd21b0ab79b989023ce73..b645bac794777a1050de116407fa834370e7940e 100644 (file)
@@ -148,7 +148,7 @@ int PhyloSummary::addSeqToTree(string seqName, string seqTaxonomy){
                                        //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);
@@ -183,7 +183,7 @@ int PhyloSummary::addSeqToTree(string seqName, string seqTaxonomy){
                                                //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);
@@ -254,7 +254,7 @@ int PhyloSummary::addSeqToTree(string seqTaxonomy, vector<string> names){
                                                //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;
                                                }
@@ -296,7 +296,7 @@ int PhyloSummary::addSeqToTree(string seqTaxonomy, vector<string> names){
                                                        //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;
                                                        }
index a1c981a5dc32f7b267c8c0a11e727870a426e4fe..c00a9c43b9e08cd6fd9e3cc997af5908861ba995 100644 (file)
@@ -1,5 +1,3 @@
-//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
diff --git a/seq.h b/seq.h
index 83ba30fbafc3aa1317a6fe1f65e13907b7308069..90146415cea631766f8d9ac8bd4c746e781eb8b5 100644 (file)
--- a/seq.h
+++ b/seq.h
@@ -1,5 +1,3 @@
-//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
index be3373a692b33097ef5677738b518cd549cfd914..03de189b8780bb0a898677a6afd520cb6bccd705 100644 (file)
--- a/seqdb.cpp
+++ b/seqdb.cpp
@@ -1,5 +1,3 @@
-//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
diff --git a/seqdb.h b/seqdb.h
index 6907015095f7f004ff9b1cd0d07450b0c4a1bb41..e4af98449f1f3b2dbed44341a622cb2a2ac69028 100644 (file)
--- a/seqdb.h
+++ b/seqdb.h
@@ -1,11 +1,8 @@
-//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
index 76c90c3f9eb7f2802276526c8491dee1d1ba3883..105e0a9c7411f14c6112a9b7cf5555f0701720b5 100644 (file)
@@ -7,7 +7,7 @@
  *
  */
 
-#include "sequenceParser.h"
+#include "sequenceparser.h"
 
 
 /************************************************************/
index 123791d2b8dfafcb4313fc6d0fe45e092dafc573..030ff5ab4dbb821cebaf539e0896792b7e0b65ba 100644 (file)
@@ -1,13 +1,11 @@
-//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
index 95590404d57f43b94ed1c18a9d714cfed2bb11f7..918d4f89193ff8124fea164316e1a9cb73693eb3 100644 (file)
@@ -1,5 +1,3 @@
-//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
@@ -227,9 +225,8 @@ const byte *SFasta::GetNextSeqLo()
                        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
index 79ab9617527efa014fad336156d8dd7064865748..ed2f2ffb56afea966a61b241e5b54645eb76f75c 100644 (file)
--- a/sfasta.h
+++ b/sfasta.h
@@ -1,5 +1,3 @@
-//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
index 4db7847346356b41a8a12a9e226413f2e81abecb..0a80aee10aec83e3521d7e35642489afc91392f8 100644 (file)
--- a/timing.h
+++ b/timing.h
@@ -1,5 +1,3 @@
-//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
 
@@ -59,29 +57,30 @@ const unsigned AllocerCount =
 #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
 
index d58b9002612aa2f0e3fab29d7ea26441af40e6f9..94159cd24aa99ab7584df620d6b576164b11531e 100644 (file)
@@ -1,5 +1,3 @@
-//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.
-
 #include "dp.h"
 
 #define TRACE  0
diff --git a/uc.h b/uc.h
index 8edef832487b8756f108ef1e1323d5ab4076dcee..3f6018a68e6e8be143ffe972ef117b01f2ca0e54 100644 (file)
--- a/uc.h
+++ b/uc.h
@@ -1,5 +1,3 @@
-//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
@@ -9,7 +7,7 @@
 \r
 struct AlnData;\r
 \r
-int uchime_main(int, char**);  \r
+int uchime_main(int, char**); \r
 \r
 class UCFile\r
        {\r
@@ -29,9 +27,6 @@ public:
        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
index 18bd8bb4fbb8cd7cde71c4044901ff4054e55f94..77266c05366a6240f0279453bfa98a7ffd389cb0 100644 (file)
@@ -1,5 +1,3 @@
-//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
@@ -8,7 +6,6 @@
 #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
@@ -21,16 +18,16 @@ bool g_UchimeDeNovo = false;
 \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
@@ -92,8 +89,6 @@ float GetAbFromLabel(const string &Label)
 \r
 int uchime_main(int argc, char *argv[])\r
        {\r
-       MothurOut* m;\r
-       m = MothurOut::getInstance();\r
                \r
        MyCmdLine(argc, argv);\r
 \r
@@ -109,7 +104,11 @@ int uchime_main(int argc, char *argv[])
                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
@@ -174,9 +173,6 @@ int uchime_main(int argc, char *argv[])
        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
@@ -201,13 +197,7 @@ int uchime_main(int argc, char *argv[])
 \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
index cc175e17fd74f0d808fc9efa11442f582333e73d..c09301f62be0cba7bb2eee024442cc94e6e5c0a3 100644 (file)
@@ -282,10 +282,11 @@ int UnifracUnweightedCommand::execute() {
                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); }
index a0d710e7b2ebbb7cffaf4aca88365a3ab73a197c..bc9d0c5048f198ac6e30309e4af0255c67dcf605 100644 (file)
@@ -277,10 +277,11 @@ int UnifracWeightedCommand::execute() {
                        
                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);
index 33f102e9363bc7ac39c3bf25f6b24059e647afd2..922dcb4a08ad3d26b5943d730a05d57bb5bafa5a 100644 (file)
--- a/usort.cpp
+++ b/usort.cpp
@@ -1,5 +1,5 @@
-//#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
@@ -83,4 +83,4 @@ void USort(const SeqData &Query, const SeqDB &DB, vector<float> &WordCounts,
        SortDescending(WordCounts, Order);\r
        }\r
 \r
-//#endif // UCHIMES\r
+#endif // UCHIMES\r
index 3f3fc970a2075a248bdace6b599773e04a84db01..2b201741448e5bad79aa93b7c9887b4cdf2bda42 100644 (file)
@@ -1,11 +1,9 @@
-//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;
@@ -68,21 +66,21 @@ static void AllocSave(unsigned LA, unsigned LB)
        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)
index b1e002db276469c0ad73a17c96b1416556340923..0b324ca9f7b720859cb54c34253dc6f1ba67f6ff 100644 (file)
--- a/windex.h
+++ b/windex.h
@@ -1,5 +1,3 @@
-//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
index 85ec26d7ed31ad1fda9349b0fb38e862e91d3ae5..ea67061fe049908012cd7ac5b6fb8c1195c00de9 100644 (file)
@@ -1,5 +1,3 @@
-//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