]> git.donarmstrong.com Git - mothur.git/blobdiff - alignment.cpp
version 1.4
[mothur.git] / alignment.cpp
index 6db3b3d9f707511fa761a6eb7cf837199770a3eb..d64d8b20bb61d7a1718c5965a41729b0b6640255 100644 (file)
@@ -9,15 +9,9 @@
  *  
  */
 
-using namespace std;
-
-#include <string>
-#include <vector>
-
 #include "alignmentcell.hpp"
 #include "alignment.hpp"
 
-#include <iostream>
 
 /**************************************************************************************************/
 
@@ -47,7 +41,7 @@ void Alignment::traceBack(){                  //      This traceback routine is used by the dynamic
        
        AlignmentCell currentCell = alignment[row][column];     //      Start the traceback from the bottom-right corner of the
                                                                                                                //      matrix
-       
+
        if(currentCell.prevCell == 'x'){        seqAaln = seqBaln = "NOALIGNMENT";              }//If there's an 'x' in the bottom-
        else{                                                                                           //      right corner bail out because it means nothing got aligned
                while(currentCell.prevCell != 'x'){                             //      while the previous cell isn't an 'x', keep going...
@@ -93,6 +87,23 @@ void Alignment::traceBack(){                 //      This traceback routine is used by the dynamic
        seqBend = seqB.length() - seqBend - 1;
 
 }
+/**************************************************************************************************/
+
+Alignment::~Alignment(){
+       try {
+               for (int i = 0; i < alignment.size(); i++) {
+                       for (int j = (alignment[i].size()-1); j >= 0; j--) {  alignment[i].pop_back();  }
+               }
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the Alignment class Function ~Alignment. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the Alignment class function ~Alignment. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
 
 /**************************************************************************************************/