X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=chimerauchimecommand.h;h=dfb410f1acf31390df8c511b87e5a0f9dce74283;hb=e0ce7cbc93d7d2fbb753ca694182db092a0ea0e7;hp=6e1f809ce55a332020240bdc0b5e30398b5d5b49;hpb=e0dc0bcef2a0f7e1f63abb531dbb1ad533da98ca;p=mothur.git diff --git a/chimerauchimecommand.h b/chimerauchimecommand.h index 6e1f809..dfb410f 100644 --- a/chimerauchimecommand.h +++ b/chimerauchimecommand.h @@ -45,7 +45,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 +59,7 @@ private: int printFile(vector&, string); int deconvoluteResults(SequenceParser&, string, string, string); int driverGroups(SequenceParser&, string, string, string, string, int, int, vector); - int createProcessesGroups(SequenceParser&, string, string, string, string, vector); + int createProcessesGroups(SequenceParser&, string, string, string, string, vector, string, string, string); }; @@ -74,7 +74,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 +84,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 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 gr, MothurOut* mout, int st, int en, int tid) { fastafile = f; namefile = n; groupfile = g; @@ -100,6 +100,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; @@ -141,7 +142,7 @@ struct uchimeData { }; /**************************************************************************************************/ -#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) +#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix) #else static DWORD WINAPI MyUchimeThreadFunction(LPVOID lpParam){ uchimeData* pDataArray; @@ -149,6 +150,10 @@ static DWORD WINAPI MyUchimeThreadFunction(LPVOID lpParam){ try { + pDataArray->outputFName = pDataArray->m->getFullPathName(pDataArray->outputFName); + pDataArray->filename = pDataArray->m->getFullPathName(pDataArray->filename); + pDataArray->alns = pDataArray->m->getFullPathName(pDataArray->alns); + //clears files ofstream out, out1, out2; pDataArray->m->openOutputFile(pDataArray->outputFName, out); out.close(); @@ -179,18 +184,8 @@ static DWORD WINAPI MyUchimeThreadFunction(LPVOID lpParam){ vector cPara; - string path = pDataArray->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 = path; -#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) - uchimeCommand += "uchime "; -#else - uchimeCommand += "uchime"; - uchimeCommand = "\"" + uchimeCommand + "\""; -#endif + string uchimeCommand = pDataArray->uchimeLocation; + uchimeCommand = "\"" + uchimeCommand + "\""; char* tempUchime; tempUchime= new char[uchimeCommand.length()+1]; @@ -326,17 +321,6 @@ static DWORD WINAPI MyUchimeThreadFunction(LPVOID lpParam){ cPara.push_back(tempIdsmoothwindow); } - /*if (useMinsmoothid) { - char* tempminsmoothid = new char[14]; - //strcpy(tempminsmoothid, "--minsmoothid"); - *tempminsmoothid = '\0'; strncat(tempminsmoothid, "--minsmoothid", 13); - cPara.push_back(tempminsmoothid); - char* tempMinsmoothid = new char[minsmoothid.length()+1]; - *tempMinsmoothid = '\0'; strncat(tempMinsmoothid, minsmoothid.c_str(), minsmoothid.length()); - //strcpy(tempMinsmoothid, minsmoothid.c_str()); - cPara.push_back(tempMinsmoothid); - }*/ - if (pDataArray->useMaxp) { char* tempmaxp = new char[7]; //strcpy(tempmaxp, "--maxp"); @@ -410,10 +394,10 @@ static DWORD WINAPI MyUchimeThreadFunction(LPVOID lpParam){ //uchime_main(numArgs, uchimeParameters); //cout << "commandString = " << commandString << endl; -#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) -#else commandString = "\"" + commandString + "\""; -#endif + + if (pDataArray->m->debug) { pDataArray->m->mothurOut("[DEBUG]: uchime command = " + commandString + ".\n"); } + system(commandString.c_str()); //free memory @@ -494,6 +478,10 @@ static DWORD WINAPI MyUchimeSeqsThreadFunction(LPVOID lpParam){ try { + pDataArray->outputFName = pDataArray->m->getFullPathName(pDataArray->outputFName); + pDataArray->filename = pDataArray->m->getFullPathName(pDataArray->filename); + pDataArray->alns = pDataArray->m->getFullPathName(pDataArray->alns); + int totalSeqs = 0; int numChimeras = 0; @@ -508,11 +496,14 @@ static DWORD WINAPI MyUchimeSeqsThreadFunction(LPVOID lpParam){ vector 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); @@ -725,6 +716,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