]> git.donarmstrong.com Git - mothur.git/blobdiff - shen.cpp
broke up globaldata and moved error checking and help into commands
[mothur.git] / shen.cpp
index 6bdb9b66f601660ea0dbfe26ed89f08daf5a10df..612a253dfd56ec074ab7bc305c1bf45f5b47e3c5 100644 (file)
--- a/shen.cpp
+++ b/shen.cpp
@@ -3,28 +3,29 @@
  *  Mothur
  *
  *  Created by Thomas Ryabin on 5/18/09.
- *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *  Copyright 2009Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
 
 #include "shen.h"
-#include <math.h>
+#include "ace.h"
 
        
 /***********************************************************************/      
 EstOutput Shen::getValues(SAbundVector* rank){
 
        try {
+               globaldata = GlobalData::getInstance();
+               
                data.resize(1,0);
                
                double n = (double)rank->getNumSeqs();
                double f1 = (double)rank->get(1);
                
-               double D_rare = 0; //I didn't know what this was. Simply replace the '0' with the appropriate expression.
-               double C_rare = 1; //I didn't know what this was. Simply replace the '1' with the appropriate expression.
-               double Y_rare = 1; //I didn't know what this was. Simply replace the '1' with the appropriate expression.
+               Ace* calc = new Ace(abund);
+               EstOutput ace = calc->getValues(rank);
                
-               double f0 = D_rare/C_rare + f1/C_rare * Y_rare*Y_rare - D_rare;
+               double f0 = ace[0]-rank->getNumBins();
                
                data[0] = f0 * (1 - pow(1 - f1/n/f0, m));