]> git.donarmstrong.com Git - mothur.git/commitdiff
Merge remote-tracking branch 'mothur/master'
authorSarah Westcott <mothur.westcott@gmail.com>
Tue, 1 May 2012 12:19:31 +0000 (08:19 -0400)
committerSarah Westcott <mothur.westcott@gmail.com>
Tue, 1 May 2012 12:19:31 +0000 (08:19 -0400)
cooccurrencecommand.cpp
trialSwap2.cpp

index 45bc0f58dd9cbf5fbcb32a7038fde29fb749551d..cfde0a906d7a3138160205623bd42b59f9c2918f 100644 (file)
@@ -385,7 +385,7 @@ int CooccurrenceCommand::getCooccurrence(vector<SharedRAbundVector*>& thisLookUp
                 }
             }
         }
-        else if (matrix == "sim9") { }
+        else if (matrix == "sim9" || matrix == "sim2") { }
         else {
             m->mothurOut("[ERROR]: No model selected! \n");
             m->control_pressed = true;
@@ -408,7 +408,7 @@ int CooccurrenceCommand::getCooccurrence(vector<SharedRAbundVector*>& thisLookUp
 
         //burn-in for sim9    
         if(matrix == "sim9") {
-            for(int i=0;i<10000;i++) trial.swap_checkerboards (co_matrix, rowtotal, columntotal, ncols, nrows);
+            for(int i=0;i<10000;i++) trial.swap_checkerboards (co_matrix, ncols, nrows);
         }
 
         //populate null matrix from probability matrix, do this a lot.
@@ -451,7 +451,6 @@ int CooccurrenceCommand::getCooccurrence(vector<SharedRAbundVector*>& thisLookUp
             
             else if(matrix == "sim4") {
                 for(int i=0;i<nrows;i++) {
-                    previous = 0.0;
                     count = 0;
                     while(count < rowtotal[i]) {
                         previous = 0.0;
@@ -494,7 +493,7 @@ int CooccurrenceCommand::getCooccurrence(vector<SharedRAbundVector*>& thisLookUp
             
             //swap_checkerboards takes the original matrix and swaps checkerboards
             else if(matrix == "sim9") {
-                trial.swap_checkerboards (co_matrix, rowtotal, columntotal, ncols, nrows);
+                trial.swap_checkerboards (co_matrix, ncols, nrows);
             }
             else {
                 m->mothurOut("[ERROR]: No null model selected!\n\n"); m->control_pressed = true;
index c51a5b7c0be1d3048851325da8be9cb26b414949..a0c3210c33dd49c97274b4ad555efe2a75f9fede 100644 (file)
@@ -192,10 +192,10 @@ int TrialSwap2::calc_combo (int nrows, int ncols, vector<vector<int> > &nullmatr
     }
 }
 /**************************************************************************************************/
-int TrialSwap2::swap_checkerboards (vector<vector<int> > &co_matrix,  vector<int> rowtotal, vector<int> columntotal, int ncols, int nrows)
+int TrialSwap2::swap_checkerboards (vector<vector<int> > &co_matrix, int ncols, int nrows)
 {
     try {
-        int ncols = co_matrix[0].size(); int nrows = co_matrix.size();
+        //int ncols = co_matrix[0].size(); int nrows = co_matrix.size();
         int i, j, k, l;
         i = m->getRandomIndex(nrows-1);
         while((j = m->getRandomIndex(nrows-1) ) == i ) {;if (m->control_pressed) { return 0; }}