X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=pairwiseseqscommand.cpp;h=e937b1661b90b5f8e3340178222c21a9a9cd8d9e;hb=67ea6ccd74dbd64828d31b952808255f206364ff;hp=0f8602871561c20804b49bdc948da6194b25adbe;hpb=deba0af0ccdcb6005ed5b2b82649b137c63fbdf7;p=mothur.git diff --git a/pairwiseseqscommand.cpp b/pairwiseseqscommand.cpp index 0f86028..e937b16 100644 --- a/pairwiseseqscommand.cpp +++ b/pairwiseseqscommand.cpp @@ -581,6 +581,9 @@ void PairwiseSeqsCommand::createProcesses(string filename) { //Close all thread handles and free memory allocations. for(int i=0; i < pDataArray.size(); i++){ + if (pDataArray[i]->count != (pDataArray[i]->end-pDataArray[i]->start)) { + m->mothurOut("[ERROR]: process " + toString(i) + " only processed " + toString(pDataArray[i]->count) + " of " + toString(pDataArray[i]->end-pDataArray[i]->start) + " sequences assigned to it, quitting. \n"); m->control_pressed = true; + } CloseHandle(hThreadArray[i]); delete pDataArray[i]; } @@ -640,7 +643,8 @@ int PairwiseSeqsCommand::driver(int startLine, int endLine, string dFileName, fl outFile << setprecision(4); if((output == "lt") && startLine == 0){ outFile << alignDB.getNumSeqs() << endl; } - + int countSmall = 0; + int countAll = 0; for(int i=startLine;igetSeqAAln()); seqJ.setAligned(alignment->getSeqBAln()); - + //cout << seqI.getName() << '\t' << seqJ.getName() << endl; + //cout << alignment->getSeqAAln() << endl << alignment->getSeqBAln() << endl; + distCalculator->calcDist(seqI, seqJ); double dist = distCalculator->getDist(); - + + //cout << "dist = " << dist << endl; + if(dist <= cutoff){ + if (dist < 0.01) { countSmall++; } + countAll++; + if (output == "column") { outFile << alignDB.get(i).getName() << ' ' << alignDB.get(j).getName() << ' ' << dist << endl; } } if (output == "lt") { outFile << dist << '\t'; } @@ -687,7 +698,7 @@ int PairwiseSeqsCommand::driver(int startLine, int endLine, string dFileName, fl } m->mothurOut(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine(); - + cout << "num less than 0.01 = " << countSmall << " of " << countAll << endl; outFile.close(); delete alignment; delete distCalculator;