X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=distancedb.cpp;h=27e278574493c89d0197d99cbe71c0c3dd03d0d9;hp=8d0c6298578c4311a59407610ae28a87f48ee493;hb=1a20e24ee786195ab0e1cccd4f5aede7a88f3f4e;hpb=fa08e82ec2dd48f73d051c210dad54a403308949 diff --git a/distancedb.cpp b/distancedb.cpp index 8d0c629..27e2785 100644 --- a/distancedb.cpp +++ b/distancedb.cpp @@ -13,8 +13,9 @@ #include "distancedb.hpp" #include "onegapignore.h" + /**************************************************************************************************/ -DistanceDB::DistanceDB() { +DistanceDB::DistanceDB() : Database() { try { templateAligned = true; templateSeqsLength = 0; @@ -49,6 +50,7 @@ void DistanceDB::addSequence(Sequence seq) { vector DistanceDB::findClosestSequences(Sequence* query, int numWanted){ try { vector topMatches; + Scores.clear(); bool templateSameLength = true; string sequence = query->getAligned(); vector dists; @@ -87,6 +89,7 @@ vector DistanceDB::findClosestSequences(Sequence* query, int numWanted){ //fill topmatches with numwanted closest sequences indexes for (int i = 0; i < numWanted; i++) { topMatches.push_back(dists[i].seq2); + Scores.push_back(dists[i].dist); } }else { int bestIndex = 0; @@ -103,6 +106,7 @@ vector DistanceDB::findClosestSequences(Sequence* query, int numWanted){ } searchScore = smallDist; topMatches.push_back(bestIndex); + Scores.push_back(smallDist); } }else{