]> git.donarmstrong.com Git - mothur.git/blobdiff - parsimony.cpp
fixed parsimony bug
[mothur.git] / parsimony.cpp
index 0dea64e99a5f7bbe3adfe3dbd648ab8fb5365acf..fc1a8b6f48821a3d66aa1fb9c70799260c56c241 100644 (file)
@@ -89,9 +89,12 @@ EstOutput Parsimony::getValues(Tree* t) {
                
                        //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();
@@ -99,7 +102,15 @@ 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();
-               
+                               
+//                             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)) { }
@@ -107,9 +118,12 @@ EstOutput Parsimony::getValues(Tree* t) {
                                else if(iSize > rcSize || iSize > lcSize){
                                        score++;
                                }
+//                             cout << score << endl;
                        } 
                
                        data[count] = score;
+                       string hold;
+//                     cin >> hold;
                }
                
                return data;