X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=parsimony.cpp;h=e76a7b039c4e91afec85c27f375b22f120185f7b;hb=9099173ea17b13be96563c7579ecc8dc2ef65d20;hp=3ef141ed8518eb4ff9a0057152484d2ef85b3968;hpb=06da1833191d5dee7e206f436d9631680f1e7c42;p=mothur.git diff --git a/parsimony.cpp b/parsimony.cpp index 3ef141e..e76a7b0 100644 --- a/parsimony.cpp +++ b/parsimony.cpp @@ -17,7 +17,12 @@ EstOutput Parsimony::getValues(Tree* t) { data.resize(1,0); int score = 0; - + + //create pgroups that reflect the groups the user want to use + for(int i=t->getNumLeaves();igetNumNodes();i++){ + t->tree[i].pGroups = (t->mergeUserGroups(i)); + } + for(int i=t->getNumLeaves();igetNumNodes();i++){ int lc = t->tree[i].getLChild(); int rc = t->tree[i].getRChild(); @@ -25,21 +30,7 @@ EstOutput Parsimony::getValues(Tree* t) { int iSize = t->tree[i].pGroups.size(); int rcSize = t->tree[rc].pGroups.size(); int lcSize = t->tree[lc].pGroups.size(); - - //add in all the groups the users wanted - for (it = t->tree[i].pGroups.begin(); it != t->tree[i].pGroups.end(); it++) { - if (inUsersGroups(it->first, globaldata->Groups) != true) { iSize--; } - } - //add in all the groups the users wanted - for (it = t->tree[rc].pGroups.begin(); it != t->tree[rc].pGroups.end(); it++) { - if (inUsersGroups(it->first, globaldata->Groups) != true) { rcSize--; } - } - - //add in all the groups the users wanted - for (it = t->tree[lc].pGroups.begin(); it != t->tree[lc].pGroups.end(); it++) { - if (inUsersGroups(it->first, globaldata->Groups) != true) { lcSize--; } - } - + //if isize are 0 then that branch is to be ignored if (iSize == 0) { } else if ((rcSize == 0) || (lcSize == 0)) { } @@ -47,8 +38,13 @@ EstOutput Parsimony::getValues(Tree* t) { else if(iSize > rcSize || iSize > lcSize){ score++; } + cout << i << ' ' << score << ": "; + t->tree[i].printNode(); } + string hold; + cin >> hold; + data[0] = score; return data; @@ -64,3 +60,5 @@ EstOutput Parsimony::getValues(Tree* t) { } +/**************************************************************************************************/ +