]> git.donarmstrong.com Git - mothur.git/blobdiff - knn.cpp
working on chimera.perseus. made removeConfidences function smarter. Fixed bug in...
[mothur.git] / knn.cpp
diff --git a/knn.cpp b/knn.cpp
index a8430723fdd653899e9239b22adaa941af113012..6053b6e47a1f16c1398c2c183cd40eef0aefeda0 100644 (file)
--- a/knn.cpp
+++ b/knn.cpp
 #include "knn.h"
 
 /**************************************************************************************************/
-Knn::Knn(string tfile, string tempFile, string method, int kmerSize, float gapOpen, float gapExtend, float match, float misMatch, int n) 
+Knn::Knn(string tfile, string tempFile, string method, int kmerSize, float gapOpen, float gapExtend, float match, float misMatch, int n, int tid
 : Classify(), num(n), search(method) {
        try {
+               threadID = tid;
+               
                //create search database and names vector
                generateDatabaseAndNames(tfile, tempFile, method, kmerSize, gapOpen, gapExtend, match, misMatch);
        }
@@ -26,7 +28,7 @@ void Knn::setDistName(string s) {
        try {
                outDistName = s;
                ofstream outDistance;
-               openOutputFile(outDistName, outDistance);
+               m->openOutputFile(outDistName, outDistance);
                outDistance << "Name\tBestMatch\tDistance" << endl;
                outDistance.close();
        }
@@ -54,7 +56,7 @@ string Knn::getTaxonomy(Sequence* seq) {
                //use database to find closest seq
                vector<int> closest = database->findClosestSequences(seq, num);
        
-               if (search == "distance") { ofstream outDistance; openOutputFileAppend(outDistName, outDistance); outDistance << seq->getName() << '\t' << database->getName(closest[0]) << '\t' << database->getSearchScore() << endl; outDistance.close();  }
+               if (search == "distance") { ofstream outDistance; m->openOutputFileAppend(outDistName, outDistance); outDistance << seq->getName() << '\t' << database->getName(closest[0]) << '\t' << database->getSearchScore() << endl; outDistance.close();  }
        
                if (m->control_pressed) { return tax; }