]> git.donarmstrong.com Git - mothur.git/blobdiff - alignment.cpp
added otu.association command. added calcSpearman, calcKendall and calcPearson functi...
[mothur.git] / alignment.cpp
index 25b27604533cbefa4ba1748001a45622e9712547..235216e8e59c82be596004559445c021312acb40 100644 (file)
@@ -21,17 +21,34 @@ Alignment::Alignment() {    /*      do nothing      */      }
 
 Alignment::Alignment(int A) : nCols(A), nRows(A) {
        try {
+               m = MothurOut::getInstance();
                alignment.resize(nRows);                        //      For the Gotoh and Needleman-Wunsch we initialize the dynamic programming
                for(int i=0;i<nRows;i++){                       //      matrix by initializing a matrix that is A x A.  By default we will set A
                        alignment[i].resize(nCols);             //      at 2000 for 16S rRNA gene sequences
                }       
        }
        catch(exception& e) {
-               errorOut(e, "Alignment", "Alignment");
+               m->errorOut(e, "Alignment", "Alignment");
                exit(1);
        }
 }
+/**************************************************************************************************/
+void Alignment::resize(int A) {
+       try {
+               nCols = A;
+               nRows = A;
 
+               alignment.resize(nRows);                        
+               for(int i=0;i<nRows;i++){                       
+                       alignment[i].resize(nCols);             
+               }       
+       }
+       catch(exception& e) {
+               m->errorOut(e, "Alignment", "resize");
+               exit(1);
+       }
+}
 /**************************************************************************************************/
 
 void Alignment::traceBack(){                   //      This traceback routine is used by the dynamic programming algorithms
@@ -92,7 +109,7 @@ void Alignment::traceBack(){                 //      This traceback routine is used by the dynamic
                seqBend = seqB.length() - seqBend - 1;
        }
        catch(exception& e) {
-               errorOut(e, "Alignment", "traceBack");
+               m->errorOut(e, "Alignment", "traceBack");
                exit(1);
        }
 }
@@ -105,7 +122,7 @@ Alignment::~Alignment(){
                }
        }
        catch(exception& e) {
-               errorOut(e, "Alignment", "~Alignment");
+               m->errorOut(e, "Alignment", "~Alignment");
                exit(1);
        }
 }