]> git.donarmstrong.com Git - mothur.git/blobdiff - sharedthetayc.cpp
changes while testing
[mothur.git] / sharedthetayc.cpp
index 315a61f1310f8381e7fab74546f059d1823f11f7..864c6e63712cdc78d2cc0320ff2869c6deff196f 100644 (file)
@@ -29,14 +29,14 @@ EstOutput ThetaYC::getValues(vector<SharedRAbundVector*> shared) {
                double sumPsqQ = 0;
                
                //get the total values we need to calculate the theta denominator sums
-               for (int i = 0; i < shared[0]->size(); i++) {
+               for (int i = 0; i < shared[0]->getNumBins(); i++) {
                        //store in temps to avoid multiple repetitive function calls
                        Atotal += (double)shared[0]->getAbundance(i);
                        Btotal += (double)shared[1]->getAbundance(i);
                }
                
                //calculate the theta denominator sums
-               for (int j = 0; j < shared[0]->size(); j++) {
+               for (int j = 0; j < shared[0]->getNumBins(); j++) {
                        //store in temps to avoid multiple repetitive function calls
                        pi = shared[0]->getAbundance(j) / Atotal;
                        qi = shared[1]->getAbundance(j) / Btotal;
@@ -75,6 +75,10 @@ EstOutput ThetaYC::getValues(vector<SharedRAbundVector*> shared) {
                if (isnan(data[2]) || isinf(data[2])) { data[2] = 0; }
                
                data[0] = 1.0 - data[0];
+        double hold = data[1];
+        data[1] = 1.0 - data[2];
+        data[2] = 1.0 - hold;
+        
                return data;
        }
        catch(exception& e) {