X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=distancecommand.h;h=af55406b372dbf0f56a546be4de2bc87f5072614;hb=79ca496859f48f1c38803c0f7c603faac348fe4c;hp=66d8af15d1c3b2ffc67e747bb14c9ee7ca0f2480;hpb=ae57e166b2ed7b475ec3f466106bd76fabadd063;p=mothur.git diff --git a/distancecommand.h b/distancecommand.h index 66d8af1..af55406 100644 --- a/distancecommand.h +++ b/distancecommand.h @@ -24,7 +24,7 @@ //custom data structure for threads to use. // This is passed by void pointer so it can be any data type // that can be passed using a single void pointer (LPVOID). -typedef struct distanceData { +struct distanceData { int startLine; int endLine; string dFileName; @@ -33,7 +33,7 @@ typedef struct distanceData { vector Estimators; MothurOut* m; string output; - int numNewFasta; + int numNewFasta, count; string countends; distanceData(){} @@ -53,7 +53,7 @@ typedef struct distanceData { }; /**************************************************************************************************/ -#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) +#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix) #else static DWORD WINAPI MyDistThreadFunction(LPVOID lpParam){ distanceData* pDataArray; @@ -86,7 +86,7 @@ static DWORD WINAPI MyDistThreadFunction(LPVOID lpParam){ ofstream outFile(pDataArray->dFileName.c_str(), ios::trunc); outFile.setf(ios::fixed, ios::showpoint); outFile << setprecision(4); - + pDataArray->count = 0; if (pDataArray->output != "square") { if((pDataArray->output == "lt") && (pDataArray->startLine == 0)){ outFile << pDataArray->alignDB.getNumSeqs() << endl; } @@ -121,9 +121,9 @@ static DWORD WINAPI MyDistThreadFunction(LPVOID lpParam){ if(i % 100 == 0){ pDataArray->m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine(); } - + pDataArray->count++; } - pDataArray->m->mothurOut(toString(pDataArray->endLine-1) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine(); + pDataArray->m->mothurOut(toString(pDataArray->count) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine(); }else{ if(pDataArray->startLine == 0){ outFile << pDataArray->alignDB.getNumSeqs() << endl; } @@ -150,9 +150,9 @@ static DWORD WINAPI MyDistThreadFunction(LPVOID lpParam){ if(i % 100 == 0){ pDataArray->m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine(); } - + pDataArray->count++; } - pDataArray->m->mothurOut(toString(pDataArray->endLine-1) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine(); + pDataArray->m->mothurOut(toString(pDataArray->count) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine(); } outFile.close(); @@ -178,7 +178,9 @@ public: vector setParameters(); string getCommandName() { return "dist.seqs"; } string getCommandCategory() { return "Sequence Processing"; } + string getHelpString(); + string getOutputPattern(string); string getCitation() { return "Schloss PD (2010). The effects of alignment quality, distance calculation method, sequence filtering, and region on the analysis of 16S rRNA gene-based studies. PLoS Comput Biol 6: e1000844. \nhttp://www.mothur.org/wiki/Dist.seqs"; } string getDescription() { return "calculate the pairwaise distances between aligned sequences"; }