5 * Created by Sarah Westcott on 1/8/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "sharedchao1.h"
12 #include "sharedjest.h"
15 /***********************************************************************/
17 EstOutput Jest::getValues(vector<SharedRAbundVector*> shared) {
19 EstOutput S1, S2, S12;
24 /*S1, S2 = number of OTUs estimated in A and B using the Chao estimator
25 S12 = estimated number of OTUs shared between A and B using the SharedChao estimator*/
29 SharedChao1* sharedChao = new SharedChao1();
30 Chao1* chaoS1 = new Chao1();
31 Chao1* chaoS2 = new Chao1();
32 SAbundVector* chaoS1Sabund = new SAbundVector();
33 SAbundVector* chaoS2Sabund = new SAbundVector();
35 *chaoS1Sabund = shared[0]->getSAbundVector();
36 *chaoS2Sabund = shared[1]->getSAbundVector();
38 S12 = sharedChao->getValues(shared);
39 S1 = chaoS1->getValues(chaoS1Sabund);
40 S2 = chaoS2->getValues(chaoS2Sabund);
42 data[0] = S12[0] / (float)(S1[0] + S2[0] - S12[0]);
44 if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
55 m->errorOut(e, "Jest", "getValues");
60 /***********************************************************************/