X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=shen.cpp;fp=shen.cpp;h=61291a62554a3ccfb0a1b35bd761fb5bfcf1e881;hb=d873f7bf94309317a08c8757e0d0d60b06fbd473;hp=c8368c641135e3676e687c708cc1dd616e1298b4;hpb=36a8526766106bce1412e530e99f9c699dd59105;p=mothur.git diff --git a/shen.cpp b/shen.cpp index c8368c6..61291a6 100644 --- a/shen.cpp +++ b/shen.cpp @@ -8,23 +8,27 @@ */ #include "shen.h" -#include +#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. + int abund; + convert(globaldata->getAbund(), abund); + + 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 = n - ace[0]; data[0] = f0 * (1 - pow(1 - f1/n/f0, m));