5 * Created by Sarah Westcott on 1/26/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "parsimony.h"
12 /**************************************************************************************************/
13 EstOutput Parsimony::getValues(Tree* t) {
15 globaldata = GlobalData::getInstance();
21 for(int i=t->getNumLeaves();i<t->getNumNodes();i++){
22 int lc = t->tree[i].getLChild();
23 int rc = t->tree[i].getRChild();
25 int iSize = t->tree[i].pGroups.size();
26 int rcSize = t->tree[rc].pGroups.size();
27 int lcSize = t->tree[lc].pGroups.size();
29 //add in all the groups the users wanted
30 for (it = t->tree[i].pGroups.begin(); it != t->tree[i].pGroups.end(); it++) {
31 if (inUsersGroups(it->first, globaldata->Groups) != true) { iSize--; }
33 //add in all the groups the users wanted
34 for (it = t->tree[rc].pGroups.begin(); it != t->tree[rc].pGroups.end(); it++) {
35 if (inUsersGroups(it->first, globaldata->Groups) != true) { rcSize--; }
38 //add in all the groups the users wanted
39 for (it = t->tree[lc].pGroups.begin(); it != t->tree[lc].pGroups.end(); it++) {
40 if (inUsersGroups(it->first, globaldata->Groups) != true) { lcSize--; }
43 //if isize are 0 then that branch is to be ignored
45 else if ((rcSize == 0) || (lcSize == 0)) { }
46 //if you have more groups than either of your kids then theres been a change.
47 else if(iSize > rcSize || iSize > lcSize){
57 cout << "Standard Error: " << e.what() << " has occurred in the Parsimony class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
61 cout << "An unknown error has occurred in the Parsimony class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";