X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=pairwiseseqscommand.h;h=cb68e7fa8ef44ce231284e11f3f9a669396d6a44;hp=e75f63c3fe80a4eaad7a2bccfae3ad266346b9e4;hb=050a3ff02473a3d4c0980964e1a9ebe52e55d6b8;hpb=0caf3fbabaa3ece404f8ce77f4c883dc5b1bf1dc diff --git a/pairwiseseqscommand.h b/pairwiseseqscommand.h index e75f63c..cb68e7f 100644 --- a/pairwiseseqscommand.h +++ b/pairwiseseqscommand.h @@ -40,7 +40,9 @@ public: vector setParameters(); string getCommandName() { return "pairwise.seqs"; } string getCommandCategory() { return "Sequence Processing"; } + string getHelpString(); + string getOutputPattern(string); string getCitation() { return "Needleman SB, Wunsch CD (1970). A general method applicable to the search for similarities in the amino acid sequence of two proteins. J Mol Biol 48: 443-53. [ for needleman ]\nGotoh O (1982). An improved algorithm for matching biological sequences. J Mol Biol 162: 705-8. [ for gotoh ] \nhttp://www.mothur.org/wiki/Pairwise.seqs"; } string getDescription() { return "calculates pairwise distances from an unaligned fasta file"; } @@ -93,7 +95,7 @@ struct pairwiseData { SequenceDB alignDB; pairwiseData(){} - pairwiseData(string ofn, string al, string sq, string di, bool co, string op, SequenceDB DB, MothurOut* mout, unsigned long long st, unsigned long long en, float ma, float misMa, float gapO, float gapE, int thr, int tid) { + pairwiseData(string ofn, string al, string sq, string di, bool co, string op, SequenceDB DB, MothurOut* mout, unsigned long long st, unsigned long long en, float ma, float misMa, float gapO, float gapE, int thr, float cu, int tid) { outputFileName = ofn; m = mout; start = st; @@ -110,6 +112,7 @@ struct pairwiseData { alignDB = DB; count = 0; output = op; + cutoff = cu; threadID = tid; } }; @@ -126,7 +129,7 @@ static DWORD WINAPI MyPairwiseSquareThreadFunction(LPVOID lpParam){ outFile.setf(ios::fixed, ios::showpoint); outFile << setprecision(4); - pDataArray->count = pDataArray->end; + pDataArray->count = 0; int startTime = time(NULL); @@ -160,6 +163,7 @@ static DWORD WINAPI MyPairwiseSquareThreadFunction(LPVOID lpParam){ if(pDataArray->start == 0){ outFile << pDataArray->alignDB.getNumSeqs() << endl; } for(int i=pDataArray->start;iend;i++){ + pDataArray->count++; string name = pDataArray->alignDB.get(i).getName(); //pad with spaces to make compatible @@ -195,11 +199,11 @@ static DWORD WINAPI MyPairwiseSquareThreadFunction(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->m->mothurOut(toString(pDataArray->end-1) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine(); + pDataArray->m->mothurOutJustToScreen(toString(pDataArray->count) + "\t" + toString(time(NULL) - startTime)+"\n"); outFile.close(); delete alignment; @@ -222,8 +226,6 @@ static DWORD WINAPI MyPairwiseThreadFunction(LPVOID lpParam){ ofstream outFile((pDataArray->outputFileName).c_str(), ios::trunc); outFile.setf(ios::fixed, ios::showpoint); outFile << setprecision(4); - - pDataArray->count = pDataArray->end; int startTime = time(NULL); @@ -256,7 +258,9 @@ static DWORD WINAPI MyPairwiseThreadFunction(LPVOID lpParam){ if((pDataArray->output == "lt") && pDataArray->start == 0){ outFile << pDataArray->alignDB.getNumSeqs() << endl; } + pDataArray->count = 0; for(int i=pDataArray->start;iend;i++){ + pDataArray->count++; if(pDataArray->output == "lt") { string name = pDataArray->alignDB.get(i).getName(); @@ -298,11 +302,11 @@ static DWORD WINAPI MyPairwiseThreadFunction(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->m->mothurOut(toString(pDataArray->end-1) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine(); + pDataArray->m->mothurOutJustToScreen(toString(pDataArray->end-1) + "\t" + toString(time(NULL) - startTime)+"\n"); outFile.close(); delete alignment;