]> git.donarmstrong.com Git - mothur.git/blobdiff - chimerauchimecommand.h
added load.logfile command. changed summary.single output for subsample=t.
[mothur.git] / chimerauchimecommand.h
index 499b18298dfffc66657f62fd00d48d7c3846bb15..5423a171d5698bda82c5869401e3509e1f059439 100644 (file)
@@ -26,6 +26,7 @@ public:
        vector<string> setParameters();
        string getCommandName()                 { return "chimera.uchime";              }
        string getCommandCategory()             { return "Sequence Processing"; }
+       string getOutputFileNameTag(string, string);
        string getHelpString(); 
        string getCitation() { return "uchime by Robert C. Edgar\nhttp://drive5.com/uchime\nThis code is donated to the public domain.\nhttp://www.mothur.org/wiki/Chimera.uchime\nEdgar,R.C., Haas,B.J., Clemente,J.C., Quince,C. and Knight,R. (2011), UCHIME improves sensitivity and speed of chimera detection, Bioinformatics, in press.\n"; }
        string getDescription()         { return "detect chimeric sequences"; }
@@ -45,7 +46,7 @@ private:
        int createProcesses(string, string, string, string, int&);
                
        bool abort, useAbskew, chimealns, useMinH, useMindiv, useXn, useDn, useXa, useChunks, useMinchunk, useIdsmoothwindow, useMinsmoothid, useMaxp, skipgaps, skipgaps2, useMinlen, useMaxlen, ucl, useQueryfract;
-       string fastafile, groupfile, templatefile, outputDir, namefile, abskew, minh, mindiv, xn, dn, xa, chunks, minchunk, idsmoothwindow, minsmoothid, maxp, minlen, maxlen, queryfract;
+       string fastafile, groupfile, templatefile, outputDir, namefile, abskew, minh, mindiv, xn, dn, xa, chunks, minchunk, idsmoothwindow, minsmoothid, maxp, minlen, maxlen, queryfract, uchimeLocation;
        int processors;
        
        
@@ -59,7 +60,7 @@ private:
        int printFile(vector<seqPriorityNode>&, string);
        int deconvoluteResults(SequenceParser&, string, string, string);
        int driverGroups(SequenceParser&, string, string, string, string, int, int, vector<string>);
-       int createProcessesGroups(SequenceParser&, string, string, string, string, vector<string>);
+       int createProcessesGroups(SequenceParser&, string, string, string, string, vector<string>, string, string, string);
 
 
 };
@@ -74,7 +75,7 @@ struct uchimeData {
        string namefile; 
        string groupfile;
        string outputFName;
-       string accnos, alns, filename, templatefile;
+       string accnos, alns, filename, templatefile, uchimeLocation;
        MothurOut* m;
        int start;
        int end;
@@ -84,7 +85,7 @@ struct uchimeData {
        string abskew, minh, mindiv, xn, dn, xa, chunks, minchunk, idsmoothwindow, minsmoothid, maxp, minlen, maxlen, queryfract;
        
        uchimeData(){}
-       uchimeData(string o, string t, string file, string f, string n, string g, string ac,  string al, vector<string> gr, MothurOut* mout, int st, int en, int tid) {
+       uchimeData(string o, string uloc, string t, string file, string f, string n, string g, string ac,  string al, vector<string> gr, MothurOut* mout, int st, int en, int tid) {
                fastafile = f;
                namefile = n;
                groupfile = g;
@@ -100,6 +101,7 @@ struct uchimeData {
                groups = gr;
                count = 0;
                numChimeras = 0;
+        uchimeLocation = uloc;
        }
        void setBooleans(bool Abskew, bool calns, bool MinH, bool Mindiv, bool Xn, bool Dn, bool Xa, bool Chunks, bool Minchunk, bool Idsmoothwindow, bool Minsmoothid, bool Maxp, bool skipgap, bool skipgap2, bool Minlen, bool Maxlen, bool uc, bool Queryfract) {
                useAbskew = Abskew;
@@ -183,18 +185,8 @@ static DWORD WINAPI MyUchimeThreadFunction(LPVOID lpParam){
                        
                        vector<char*> cPara;
                        
-                       string path = pDataArray->m->argv;
-                       string tempPath = path;
-                       for (int j = 0; j < path.length(); j++) { tempPath[j] = tolower(path[j]); }
-                       path = path.substr(0, (tempPath.find_last_of('m')));
-                       
-                       string uchimeCommand = path;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
-                       uchimeCommand += "uchime ";
-#else
-                       uchimeCommand += "uchime";
-                       uchimeCommand = "\"" + uchimeCommand + "\"";
-#endif                 
+            string uchimeCommand = pDataArray->uchimeLocation;
+            uchimeCommand = "\"" + uchimeCommand + "\"";
                        
                        char* tempUchime;
                        tempUchime= new char[uchimeCommand.length()+1]; 
@@ -403,10 +395,10 @@ static DWORD WINAPI MyUchimeThreadFunction(LPVOID lpParam){
                        
                        //uchime_main(numArgs, uchimeParameters); 
                        //cout << "commandString = " << commandString << endl;
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
-#else
                        commandString = "\"" + commandString + "\"";
-#endif
+            
+            if (pDataArray->m->debug) { pDataArray->m->mothurOut("[DEBUG]: uchime command = " + commandString + ".\n"); }
+            
                        system(commandString.c_str());
                        
                        //free memory
@@ -505,11 +497,14 @@ static DWORD WINAPI MyUchimeSeqsThreadFunction(LPVOID lpParam){
                
                vector<char*> cPara;
                
-               char* tempUchime;
-               tempUchime= new char[8]; 
-               *tempUchime = '\0';
-               strncat(tempUchime, "uchime ", 7); 
-               cPara.push_back(tempUchime);
+               string uchimeCommand = pDataArray->uchimeLocation;
+        uchimeCommand = "\"" + uchimeCommand + "\"";
+        
+        char* tempUchime;
+        tempUchime= new char[uchimeCommand.length()+1]; 
+        *tempUchime = '\0';
+        strncat(tempUchime, uchimeCommand.c_str(), uchimeCommand.length());
+        cPara.push_back(tempUchime);
                
                char* tempIn = new char[8]; 
                *tempIn = '\0'; strncat(tempIn, "--input", 7);
@@ -722,6 +717,7 @@ static DWORD WINAPI MyUchimeSeqsThreadFunction(LPVOID lpParam){
                
                //uchime_main(numArgs, uchimeParameters); 
                //cout << "commandString = " << commandString << endl;
+        if (pDataArray->m->debug) { pDataArray->m->mothurOut("[DEBUG]: uchime command = " + commandString + ".\n"); }
                system(commandString.c_str());
                
                //free memory