X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=weighted.cpp;h=581078085d4e573ad100dbc48f1ec87d64558efa;hb=503b23b959230453d95dc812fbbe088b3be6910c;hp=fa22716e397c4dddb1dd1ab29e2cd04d40b10311;hpb=8fd4a602269974e6548f4a387dddd6bd80a999ab;p=mothur.git diff --git a/weighted.cpp b/weighted.cpp index fa22716..5810780 100644 --- a/weighted.cpp +++ b/weighted.cpp @@ -39,14 +39,14 @@ EstOutput Weighted::getValues(Tree* t) { //if you have a BL if(t->tree[index].getBranchLength() != -1){ - sum += t->tree[index].getBranchLength(); + sum += abs(t->tree[index].getBranchLength()); } index = t->tree[index].getParent(); } //get last breanch length added if(t->tree[index].getBranchLength() != -1){ - sum += t->tree[index].getBranchLength(); + sum += abs(t->tree[index].getBranchLength()); } //is this sum from a sequence which is in one of the users groups @@ -85,7 +85,7 @@ EstOutput Weighted::getValues(Tree* t) { u -= (double) t->tree[i].pcount[globaldata->Groups[l]] / (double) tmap->seqsPerGroup[globaldata->Groups[l]]; } - u = abs(u) * t->tree[i].getBranchLength(); + u = abs(u * t->tree[i].getBranchLength()); //save groupcombs u value WScore[globaldata->Groups[b]+globaldata->Groups[l]] += u; @@ -142,14 +142,14 @@ EstOutput Weighted::getValues(Tree* t, string groupA, string groupB) { //if you have a BL if(t->tree[index].getBranchLength() != -1){ - sum += t->tree[index].getBranchLength(); + sum += abs(t->tree[index].getBranchLength()); } index = t->tree[index].getParent(); } //get last breanch length added if(t->tree[index].getBranchLength() != -1){ - sum += t->tree[index].getBranchLength(); + sum += abs(t->tree[index].getBranchLength()); } if ((t->tree[v].getGroup() == groupA) || (t->tree[v].getGroup() == groupB)) { @@ -177,7 +177,7 @@ EstOutput Weighted::getValues(Tree* t, string groupA, string groupB) { u -= (double) t->tree[i].pcount[groupB] / (double) tmap->seqsPerGroup[groupB]; } - u = abs(u) * t->tree[i].getBranchLength(); + u = abs(u * t->tree[i].getBranchLength()); //save groupcombs u value WScore[(groupA+groupB)] += u;