]> git.donarmstrong.com Git - mothur.git/blobdiff - distancedb.cpp
worked on hcluster. made .single command run using a sharedfile. and various other...
[mothur.git] / distancedb.cpp
index 90b7724ed709ac27f510cad9c928a8b48fca9675..d6ec258702207ca1312e004f0f275095f506f326 100644 (file)
@@ -29,8 +29,7 @@ DistanceDB::DistanceDB(string fastaFileName, string distanceFileName) : Database
        mostSimSequenceVector.resize(numCandSeqs);
        
        for(int i=0;i<numCandSeqs;i++){
-               inputData >> candidateSeqName >> closestMatch.seqName >> closestMatch.indexNumber >> closestMatch.simScore;
-//             getline(inputData, junk);       
+               inputData >> candidateSeqName >> closestMatch.seqName >> closestMatch.indexNumber >> closestMatch.simScore;     
                mostSimSequenceVector[i] = closestMatch;
        }
        mothurOut(toString(numCandSeqs)); mothurOutEndLine();
@@ -55,7 +54,8 @@ Sequence DistanceDB::findClosestSequence(Sequence* candidateSeq){
        searchScore = 100. * simAccession.simScore;
        searchIndex++;
 //     return templateSequences[closestMatchIndexNumber];
-       return templateSequences[simAccession.indexNumber];
+       if (templateValid) {  return templateSequences[simAccession.indexNumber];       }
+       else {  return emptySequence;   }
        
 }