X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=shen.cpp;h=dac12bd69e83fb635c5b1ab1433a776940332e8e;hp=c8368c641135e3676e687c708cc1dd616e1298b4;hb=050a3ff02473a3d4c0980964e1a9ebe52e55d6b8;hpb=b22853b5cfbf5c47949ad2a084f2fad88b2e4be4 diff --git a/shen.cpp b/shen.cpp index c8368c6..dac12bd 100644 --- a/shen.cpp +++ b/shen.cpp @@ -8,37 +8,35 @@ */ #include "shen.h" -#include +#include "ace.h" /***********************************************************************/ EstOutput Shen::getValues(SAbundVector* rank){ try { + 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, f)); + + delete calc; - data[0] = f0 * (1 - pow(1 - f1/n/f0, m)); - return data; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the Coverage class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "Shen", "getValues"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the Coverage class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } -}; +} /***********************************************************************/