X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=shen.cpp;fp=shen.cpp;h=6bdb9b66f601660ea0dbfe26ed89f08daf5a10df;hb=2bb51be6ba6a3fa741f2131d328cf21c395b506a;hp=0000000000000000000000000000000000000000;hpb=b02ee39bf6c708a98748f8861846cdec7fab58ac;p=mothur.git diff --git a/shen.cpp b/shen.cpp new file mode 100644 index 0000000..6bdb9b6 --- /dev/null +++ b/shen.cpp @@ -0,0 +1,44 @@ +/* + * shen.cpp + * Mothur + * + * Created by Thomas Ryabin on 5/18/09. + * Copyright 2009 __MyCompanyName__. All rights reserved. + * + */ + +#include "shen.h" +#include + + +/***********************************************************************/ +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. + + double f0 = D_rare/C_rare + f1/C_rare * Y_rare*Y_rare - D_rare; + + 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"; + 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); + } +}; + + +/***********************************************************************/