string sequence = query->getAligned();
vector<seqDist> dists;
- if (numWanted > data.size()) { m->mothurOut("numwanted is larger than the number of template sequences, using 10."); m->mothurOutEndLine(); numWanted = 10; }
+ 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(); }
if (sequence.length() != templateSeqsLength) { templateSameLength = false; }
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);