EstOutput Ace::getValues(SAbundVector* rank) {
try {
- cout << "abund = " << abund << "\n";
data.resize(3,0);
- // vector<double> aceData(3,0);
double ace, acelci, acehci;
int nrare = 0;
//create pgroups that reflect the groups the user want to use
for(int i=copyTree->getNumLeaves();i<copyTree->getNumNodes();i++){
+// cout << i << "..." << endl;
copyTree->tree[i].pGroups = (copyTree->mergeUserGroups(i, groups));
}
+// map<string,int>::iterator it;
+
for(int i=copyTree->getNumLeaves();i<copyTree->getNumNodes();i++){
int lc = copyTree->tree[i].getLChild();
int rc = copyTree->tree[i].getRChild();
int iSize = copyTree->tree[i].pGroups.size();
int rcSize = copyTree->tree[rc].pGroups.size();
int lcSize = copyTree->tree[lc].pGroups.size();
-
+
+// cout << i+1 << '\t' << lc+1 << '\t' << rc+1 << ":\t";
+
+// for(it=copyTree->tree[i].pGroups.begin();it!=copyTree->tree[i].pGroups.end();it++){
+// cout << it->first << '\t';
+// }
+
+// cout << " : " << iSize << '\t' << rcSize << '\t' << lcSize << '\t';
+
//if isize are 0 then that branch is to be ignored
if (iSize == 0) { }
else if ((rcSize == 0) || (lcSize == 0)) { }
else if(iSize > rcSize || iSize > lcSize){
score++;
}
+// cout << score << endl;
}
data[count] = score;
+ string hold;
+// cin >> hold;
}
return data;
for(it=parsimony.begin();it!=parsimony.end();it++){
if(it->second == 1){
parsimony.erase(it->first);
- it--;
+// it--;
}
}
//set one remaining groups to 1
maxPars = parsimony[it->first];
}
}
-
+
// this is true if right child had a greater parsimony for a certain group
if(maxPars > 1){
//erase all the groups that are only 1 because you found something with 2.
for(it=parsimony.begin();it!=parsimony.end();it++){
if(it->second == 1){
parsimony.erase(it->first);
- it--;
}
}
- //set one remaining groups to 1
- //so with our above example p[white] = 2 would be left and it would become p[white] = 1
for(it=parsimony.begin();it!=parsimony.end();it++){
parsimony[it->first] = 1;
}
+ }
- }
-
return parsimony;
}
catch(exception& e) {