]> git.donarmstrong.com Git - mothur.git/blobdiff - rarefact.cpp
added formatmatrix, formatcolumn, and formatphylip classes. Used these classes in...
[mothur.git] / rarefact.cpp
index ba0c02e2a474545474e4cf13efbdc633bfbbb3a3..5cd9b99c5051be03b00757df6a99bfb479adabfe 100644 (file)
@@ -63,11 +63,7 @@ void Rarefact::getCurve(int increment = 1, int nIters = 1000){
                delete rcd;
        }
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the Rarefact class Function getCurve. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }
-       catch(...) {
-               cout << "An unknown error has occurred in the Rarefact class function getCurve. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               errorOut(e, "Rarefact", "getCurve");
                exit(1);
        }
 }
@@ -85,14 +81,19 @@ try {
                        rcd->registerDisplay(displays[i]);
                }
                
+               //if jumble is false all iters will be the same
+               if (globaldata->jumble == false)  {  nIters = 1;  }
+               
                for(int iter=0;iter<nIters;iter++){
                
                        for(int i=0;i<displays.size();i++){
                                displays[i]->init(label);                 
                        }
-
-                       //randomize the groups
-                       random_shuffle(lookup.begin(), lookup.end());
+                       
+                       if (globaldata->jumble == true)  {
+                               //randomize the groups
+                               random_shuffle(lookup.begin(), lookup.end());
+                       }
                        
                        //make merge the size of lookup[0]
                        SharedRAbundVector* merge = new SharedRAbundVector(lookup[0]->size());
@@ -118,6 +119,7 @@ try {
                                displays[i]->reset();
                        }
                        
+                       delete merge;
                }
                
                for(int i=0;i<displays.size();i++){
@@ -127,14 +129,9 @@ try {
                delete rcd;
        }
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the Rarefact class Function getSharedCurve. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }
-       catch(...) {
-               cout << "An unknown error has occurred in the Rarefact class function getSharedCurve. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               errorOut(e, "Rarefact", "getSharedCurve");
                exit(1);
        }
-
 }
 
 /**************************************************************************************/
@@ -146,12 +143,8 @@ void Rarefact::mergeVectors(SharedRAbundVector* shared1, SharedRAbundVector* sha
                }
        }
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the Rarefact class Function mergeVectors. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               errorOut(e, "Rarefact", "mergeVectors");
                exit(1);
        }
-       catch(...) {
-               cout << "An unknown error has occurred in the Rarefact class function mergeVectors. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }       
 }