]> git.donarmstrong.com Git - mothur.git/blobdiff - sharedbraycurtis.cpp
created blank accnos in chimera commands if no seqs are deemed chimeric. modified...
[mothur.git] / sharedbraycurtis.cpp
index d1b401eb78038aaa8d462678fe7bcbc3d2b13903..e8512d4b95bf3d2d32e058ca5c0b250d25609979 100644 (file)
@@ -10,8 +10,8 @@
 #include "sharedbraycurtis.h"
 
 /***********************************************************************/
-
-EstOutput BrayCurtis::getValues(SharedRAbundVector* shared1, SharedRAbundVector* shared2) {
+//This is used by SharedJAbund and SharedSorAbund
+EstOutput BrayCurtis::getValues(vector<SharedRAbundVector*> shared) {
        try {   
                data.resize(1,0);
                
@@ -24,10 +24,10 @@ EstOutput BrayCurtis::getValues(SharedRAbundVector* shared1, SharedRAbundVector*
                sumSharedAB = the sum of the minimum otus int all shared otus in AB.
                */
                
-               for (int i = 0; i < shared1->size(); i++) {
+               for (int i = 0; i < shared[0]->size(); i++) {
                        //store in temps to avoid multiple repetitive function calls
-                       tempA = shared1->getAbundance(i);
-                       tempB = shared2->getAbundance(i);
+                       tempA = shared[0]->getAbundance(i);
+                       tempB = shared[1]->getAbundance(i);
                        
                        sumSharedA += tempA;
                        sumSharedB += tempB;
@@ -44,15 +44,9 @@ EstOutput BrayCurtis::getValues(SharedRAbundVector* shared1, SharedRAbundVector*
                return data;
        }
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the BrayCurtis class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               m->errorOut(e, "BrayCurtis", "getValues");
                exit(1);
        }
-       catch(...) {
-               cout << "An unknown error has occurred in the BrayCurtis class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }       
-
-
 }
 
 /***********************************************************************/