5 * Created by westcott on 12/14/10.
6 * Copyright 2010 Schloss Lab. All rights reserved.
12 /***********************************************************************/
14 EstOutput Canberra::getValues(vector<SharedRAbundVector*> shared) {
18 int numSharedOTUS = 0;
22 for (int i = 0; i < shared[0]->getNumBins(); i++) {
24 int Aij = shared[0]->getAbundance(i);
25 int Bij = shared[1]->getAbundance(i);
28 if ((Aij != 0) && (Bij != 0)) { numSharedOTUS++; }
30 if ((Aij + Bij) != 0) {
31 sum += ((abs(Aij - Bij)) / (float) (Aij + Bij));
35 data[0] = (1 / (float) shared[0]->getNumBins()) * sum;
37 if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
42 m->errorOut(e, "Canberra", "getValues");
47 /***********************************************************************/