]> git.donarmstrong.com Git - mothur.git/blobdiff - suffixdb.cpp
bugs fixes while testing for 1.5 release
[mothur.git] / suffixdb.cpp
index 15f7753b65291f897103e5e7b75fe79a2d139b99..5bcd8e96c0be725ee978ba74a4d32bb36b3aa4e0 100644 (file)
 SuffixDB::SuffixDB(string fastaFileName) : Database(fastaFileName) {
 
        suffixForest.resize(numSeqs);
-       cout << "Generating the suffix tree database...\t";     cout.flush();
+       mothurOut("Generating the suffix tree database...\t");  cout.flush();
        for(int i=0;i<numSeqs;i++){                                                             //      The parent class' constructor generates the vector of
                suffixForest[i].loadSequence(templateSequences[i]);     //      template Sequence objects.  Here each of these objects
        }                                                                                                               //      is used to generate a suffix tree, aka the suffix forest
-       cout << "DONE." << endl << endl;        cout.flush();
+       mothurOut("DONE."); mothurOutEndLine(); mothurOutEndLine(); cout.flush();
 
 }
 
 /**************************************************************************************************/
 
-Sequence* SuffixDB::findClosestSequence(Sequence* candidateSeq){
+Sequence SuffixDB::findClosestSequence(Sequence* candidateSeq){
 
        int minValue = 2000;
        int closestSequenceNo = 0;
@@ -52,3 +52,11 @@ Sequence* SuffixDB::findClosestSequence(Sequence* candidateSeq){
 }
 
 /**************************************************************************************************/
+
+SuffixDB::~SuffixDB(){                                                                                                         
+       
+       for (int i = (suffixForest.size()-1); i >= 0; i--) {  suffixForest.pop_back();  }
+       // templateSequences.clear();
+
+}
+/**************************************************************************************************/