]> git.donarmstrong.com Git - mothur.git/blobdiff - parsimony.cpp
working on chimeras
[mothur.git] / parsimony.cpp
index 0dea64e99a5f7bbe3adfe3dbd648ab8fb5365acf..db6ed1d862d4ee3d9a4037b672ee63cdcacd03a6 100644 (file)
@@ -75,7 +75,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,6 +94,8 @@ EstOutput Parsimony::getValues(Tree* t) {
                                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();
@@ -99,7 +103,8 @@ EstOutput Parsimony::getValues(Tree* t) {
                                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 +115,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";
-               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";
+               errorOut(e, "Parsimony", "getValues");
                exit(1);
        }
-
 }
 
 /**************************************************************************************************/