X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=distancecommand.h;h=2f53232b5943d835e8c27adf7374a5e3a8ce168f;hp=9d5477d7ee1dca3d715189db8d61fab432c87cf3;hb=df7e3ff9f68ef157b0328a2d353c3258c5d45d89;hpb=fc1ed1ae1b022719176910ab71993bd6535810ad diff --git a/distancecommand.h b/distancecommand.h index 9d5477d..2f53232 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; } @@ -119,11 +119,10 @@ static DWORD WINAPI MyDistThreadFunction(LPVOID lpParam){ if (pDataArray->output == "lt") { outFile << endl; } if(i % 100 == 0){ - pDataArray->m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine(); - } - + pDataArray->m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n"); } + pDataArray->count++; } - pDataArray->m->mothurOut(toString(pDataArray->endLine-1) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine(); + pDataArray->m->mothurOutJustToScreen(toString(pDataArray->count) + "\t" + toString(time(NULL) - startTime)+"\n"); }else{ if(pDataArray->startLine == 0){ outFile << pDataArray->alignDB.getNumSeqs() << endl; } @@ -148,11 +147,11 @@ static DWORD WINAPI MyDistThreadFunction(LPVOID lpParam){ outFile << endl; if(i % 100 == 0){ - pDataArray->m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine(); + pDataArray->m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n"); } - + pDataArray->count++; } - pDataArray->m->mothurOut(toString(pDataArray->endLine-1) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine(); + pDataArray->m->mothurOutJustToScreen(toString(pDataArray->count) + "\t" + toString(time(NULL) - startTime)+"\n"); } outFile.close(); @@ -178,7 +177,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"; } @@ -213,8 +214,8 @@ private: #ifdef USE_MPI int driverMPI(int, int, MPI_File&, float); - int driverMPI(int, int, string, unsigned long int&); - int driverMPI(int, int, string, unsigned long int&, string); + int driverMPI(int, int, string, unsigned long long&); + int driverMPI(int, int, string, unsigned long long&, string); #endif //int convertMatrix(string);