X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=parsimony.cpp;h=0487822764bbf36e11da5bd8faada1bba34a63c4;hb=4745a956b3116a719f52f341d2a2db84df4817da;hp=7d08adf8ad3b0a0ad5a25bc98bbf74d1bacda3b9;hpb=f18d75f9c996cb619a5051a7664620c0c5ae05fb;p=mothur.git diff --git a/parsimony.cpp b/parsimony.cpp index 7d08adf..0487822 100644 --- a/parsimony.cpp +++ b/parsimony.cpp @@ -49,6 +49,9 @@ EstOutput Parsimony::getValues(Tree* t) { } for(int i=copyTree->getNumLeaves();igetNumNodes();i++){ + + if (m->control_pressed) { return data; } + int lc = copyTree->tree[i].getLChild(); int rc = copyTree->tree[i].getRChild(); @@ -75,7 +78,9 @@ EstOutput Parsimony::getValues(Tree* t) { if (numGroups == 0) { //get score for all users groups for (int i = 0; i < tmap->namesOfGroups.size(); i++) { - groups.push_back(tmap->namesOfGroups[i]); + if (tmap->namesOfGroups[i] != "xxx") { + groups.push_back(tmap->namesOfGroups[i]); + } } }else { for (int i = 0; i < globaldata->Groups.size(); i++) { @@ -89,13 +94,15 @@ EstOutput Parsimony::getValues(Tree* t) { //create pgroups that reflect the groups the user want to use for(int i=copyTree->getNumLeaves();igetNumNodes();i++){ -// cout << i << "..." << endl; copyTree->tree[i].pGroups = (copyTree->mergeUserGroups(i, groups)); } // map::iterator it; for(int i=copyTree->getNumLeaves();igetNumNodes();i++){ + + if (m->control_pressed) { return data; } + int lc = copyTree->tree[i].getLChild(); int rc = copyTree->tree[i].getRChild(); @@ -103,13 +110,6 @@ EstOutput Parsimony::getValues(Tree* t) { 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) { } @@ -118,12 +118,10 @@ EstOutput Parsimony::getValues(Tree* t) { else if(iSize > rcSize || iSize > lcSize){ score++; } -// cout << score << endl; } data[count] = score; - string hold; -// cin >> hold; + } delete copyTree; @@ -131,14 +129,9 @@ EstOutput Parsimony::getValues(Tree* t) { return data; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the Parsimony class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "Parsimony", "getValues"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the Parsimony class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } - } /**************************************************************************************************/