Permalink
Browse files

Merge pull request #298 from mothur/Windows_vsearch

Windows vsearch
  • Loading branch information...
2 parents eba2e8b + 3d3d27f commit f3cad7ba2c03227ee6655f498e8d0fb8c973fadb @mothur-westcott mothur-westcott committed on GitHub Jan 19, 2017
@@ -122,14 +122,15 @@ static DWORD WINAPI MyPerseusThreadFunction(LPVOID lpParam){
//parse fasta and name file by group
SequenceParser* parser;
SequenceCountParser* cparser;
+ vector<string> temp;
if (pDataArray->hasCount) {
CountTable* ct = new CountTable();
ct->readTable(pDataArray->namefile, true, false);
- cparser = new SequenceCountParser(pDataArray->fastafile, *ct);
+ cparser = new SequenceCountParser(pDataArray->fastafile, *ct, temp);
delete ct;
}else {
- if (pDataArray->namefile != "") { parser = new SequenceParser(pDataArray->groupfile, pDataArray->fastafile, pDataArray->namefile); }
- else { parser = new SequenceParser(pDataArray->groupfile, pDataArray->fastafile); }
+ if (pDataArray->namefile != "") { parser = new SequenceParser(pDataArray->groupfile, pDataArray->fastafile, pDataArray->namefile, temp); }
+ else { parser = new SequenceParser(pDataArray->groupfile, pDataArray->fastafile, temp); }
}
int totalSeqs = 0;
@@ -557,9 +557,6 @@ ChimeraUchimeCommand::ChimeraUchimeCommand(string option) {
//look for uchime exe
path = m->mothurProgramPath;
- //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) || (__linux__) || (__unix__) || (__unix)
@@ -575,7 +572,7 @@ ChimeraUchimeCommand::ChimeraUchimeCommand(string option) {
delete newCommand;
}
#else
- uchimeCommand = path + "uchime.exe";
+ uchimeCommand = path + "\\uchime.exe";
#endif
//test to make sure uchime exists
@@ -586,14 +583,15 @@ ChimeraUchimeCommand::ChimeraUchimeCommand(string option) {
m->mothurOut(uchimeCommand + " file does not exist. Checking path... \n");
//check to see if uchime is in the path??
- string uLocation = m->findProgramPath("uchime");
-
+ string uLocation = "";
ifstream in2;
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
+ uLocation = m->findProgramPath("uchime");
ableToOpen = m->openInputFile(uLocation, in2, "no error"); in2.close();
#else
- ableToOpen = m->openInputFile((uLocation + ".exe"), in2, "no error"); in2.close();
+ uLocation = m->findProgramPath("uchime.exe");
+ ableToOpen = m->openInputFile(uLocation, in2, "no error"); in2.close();
#endif
if(ableToOpen == 1) { m->mothurOut("[ERROR]: " + uLocation + " file does not exist. mothur requires the uchime executable."); m->mothurOutEndLine(); abort = true; }
@@ -1158,11 +1156,12 @@ int ChimeraUchimeCommand::driverGroups(string outputFName, string filename, stri
int start = time(NULL); if (m->control_pressed) { outCountList.close(); m->mothurRemove(countlist); return 0; }
int error;
- if (hasCount) { error = cparser->getSeqs(groups[i], filename, "/ab=", "/", true); if ((error == 1) || m->control_pressed) { return 0; } }
- else { error = sparser->getSeqs(groups[i], filename, "/ab=", "/", true); if ((error == 1) || m->control_pressed) { return 0; } }
-
- int numSeqs = driver((outputFName + groups[i]), filename, (accnos+groups[i]), (alns+ groups[i]), numChimeras);
+ long long numSeqs = 0;
+ if (hasCount) { error = cparser->getSeqs(groups[i], filename, "/ab=", "/", numSeqs, true); if ((error == 1) || m->control_pressed) { return 0; } }
+ else { error = sparser->getSeqs(groups[i], filename, "/ab=", "/", numSeqs, true); if ((error == 1) || m->control_pressed) { return 0; } }
totalSeqs += numSeqs;
+
+ driver((outputFName + groups[i]), filename, (accnos+groups[i]), (alns+ groups[i]), numChimeras);
if (m->control_pressed) { return 0; }
@@ -1660,7 +1659,8 @@ int ChimeraUchimeCommand::createProcesses(string outputFileName, string filename
//divide file
int count = 0;
int spot = 0;
-
+ files.resize(processors, "");
+
for (int i = 0; i < processors; i++) {
ofstream temp;
files[i] = filename+toString(i)+".temp";
@@ -1802,7 +1802,6 @@ int ChimeraUchimeCommand::createProcessesGroups(string outputFName, string filen
}
}
- m->mothurOut(toString( getpid() ) + " here\n");
//do my part
num = driverGroups(outputFName, filename, accnos, alns, accnos + ".byCount", lines[0].start, lines[0].end, groups);
@@ -165,14 +165,15 @@ static DWORD WINAPI MyUchimeThreadFunction(LPVOID lpParam){
//parse fasta and name file by group
SequenceParser* parser;
SequenceCountParser* cparser;
+ vector<string> temp;
if (pDataArray->hasCount) {
CountTable* ct = new CountTable();
ct->readTable(pDataArray->namefile, true, false);
- cparser = new SequenceCountParser(pDataArray->fastafile, *ct);
+ cparser = new SequenceCountParser(pDataArray->fastafile, *ct, temp);
delete ct;
}else {
- if (pDataArray->namefile != "") { parser = new SequenceParser(pDataArray->groupfile, pDataArray->fastafile, pDataArray->namefile); }
- else { parser = new SequenceParser(pDataArray->groupfile, pDataArray->fastafile); }
+ if (pDataArray->namefile != "") { parser = new SequenceParser(pDataArray->groupfile, pDataArray->fastafile, pDataArray->namefile, temp); }
+ else { parser = new SequenceParser(pDataArray->groupfile, pDataArray->fastafile, temp); }
}
int totalSeqs = 0;
@@ -187,13 +188,14 @@ static DWORD WINAPI MyUchimeThreadFunction(LPVOID lpParam){
int error;
+ long long numSeqs = 0;
if (pDataArray->hasCount) {
- error = cparser->getSeqs(pDataArray->groups[i], pDataArray->filename, "/ab=", "/", true); if ((error == 1) || pDataArray->m->control_pressed) { delete cparser; return 0; }
+ error = cparser->getSeqs(pDataArray->groups[i], pDataArray->filename, "/ab=", "/", numSeqs, true); if ((error == 1) || pDataArray->m->control_pressed) { delete cparser; return 0; }
}else {
- error = parser->getSeqs(pDataArray->groups[i], pDataArray->filename, "/ab=", "/", true); if ((error == 1) || pDataArray->m->control_pressed) { delete parser; return 0; }
+ error = parser->getSeqs(pDataArray->groups[i], pDataArray->filename, "/ab=", "/", numSeqs, true); if ((error == 1) || pDataArray->m->control_pressed) { delete parser; return 0; }
}
- //int numSeqs = driver((outputFName + groups[i]), filename, (accnos+ groups[i]), (alns+ groups[i]), numChimeras);
+ //driver((outputFName + groups[i]), filename, (accnos+ groups[i]), (alns+ groups[i]), numChimeras);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//to allow for spaces in the path
Oops, something went wrong.

0 comments on commit f3cad7b

Please sign in to comment.