]> git.donarmstrong.com Git - mothur.git/blobdiff - distancedb.cpp
added versioning info to all shortcut files mothur makes.
[mothur.git] / distancedb.cpp
index 5c49a936e9293c629e05ea5565f334a43e5cc37c..ca6ffe8ba61217ac0b66b353e8f33461f4916e52 100644 (file)
@@ -48,6 +48,8 @@ vector<int> DistanceDB::findClosestSequences(Sequence* query, int numWanted){
                bool templateSameLength = true;
                string sequence = query->getAligned();
                vector<seqDist> dists;
+               
+               searchScore = -1.0;
        
                if (numWanted > data.size()) { m->mothurOut("numwanted is larger than the number of template sequences, using "+ toString(data.size()) + "."); m->mothurOutEndLine(); numWanted = data.size(); }
                
@@ -66,6 +68,9 @@ vector<int> DistanceDB::findClosestSequences(Sequence* query, int numWanted){
                        
                        sort(dists.begin(), dists.end(), compareSequenceDistance);  //sorts by distance lowest to highest
                        
+                       //save distance of best match
+                       searchScore = dists[0].dist;
+                       
                        //fill topmatches with numwanted closest sequences indexes
                        for (int i = 0; i < numWanted; i++) {
                                topMatches.push_back(dists[i].seq2);