X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=parsimony.cpp;h=0487822764bbf36e11da5bd8faada1bba34a63c4;hb=c27e902ede71ea4d20af65752ef04459c101611b;hp=0dea64e99a5f7bbe3adfe3dbd648ab8fb5365acf;hpb=fc7cf3aac8fd6106fd725b43baa8ab5ca6f836f8;p=mothur.git diff --git a/parsimony.cpp b/parsimony.cpp index 0dea64e..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++) { @@ -92,14 +97,20 @@ EstOutput Parsimony::getValues(Tree* t) { 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(); int iSize = copyTree->tree[i].pGroups.size(); int rcSize = copyTree->tree[rc].pGroups.size(); int lcSize = copyTree->tree[lc].pGroups.size(); - + + //if isize are 0 then that branch is to be ignored if (iSize == 0) { } else if ((rcSize == 0) || (lcSize == 0)) { } @@ -110,19 +121,17 @@ EstOutput Parsimony::getValues(Tree* t) { } data[count] = score; + } + delete copyTree; + 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); - } - } /**************************************************************************************************/