]> git.donarmstrong.com Git - mothur.git/blobdiff - readtree.cpp
fixed bug in read tree
[mothur.git] / readtree.cpp
index 81a7729ffb474294502407eec1c44620bfff3378..a253741688c00ddc138d1353ac757456c03643da 100644 (file)
@@ -124,7 +124,8 @@ void ReadNewickTree::read() {
                                numNodes = T->getNumNodes();
                                numLeaves = T->getNumLeaves();
                                
-                               readTreeString();  
+                               readTreeString(); 
+                               
                                //save trees for later commands
                                globaldata->gTree.push_back(T); 
                                gobble(filehandle);
@@ -157,12 +158,12 @@ void ReadNewickTree::read() {
                                numLeaves = T->getNumLeaves();
                                
                                //read tree info
-                               readTreeString();  
+                               readTreeString(); 
+                                
                                //save trees for later commands
                                globaldata->gTree.push_back(T); 
                        }
                }
-               
        }
        catch(exception& e) {
                cout << "Standard Error: " << e.what() << " has occurred in the ReadNewickTree class Function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
@@ -333,27 +334,29 @@ int ReadNewickTree::readNewickInt(istream& f, int& n, Tree* T) {
                        
                        //adds sequence names that are not in group file to the "xxx" group
                        if(n1 == -1) {
-                               cerr << "Name: " << name << " not found in your groupfile and it will be ignored. \n";
-                               globaldata->gTreemap->namesOfSeqs.push_back(name);
-                               globaldata->gTreemap->treemap[name].groupname = "xxx";
-                               globaldata->gTreemap->treemap[name].vectorIndex = (globaldata->gTreemap->namesOfSeqs.size() - 1);
+                               cerr << "Name: " << name << " not found in your groupfile.. \n"; exit(1);
                                
-                               map<string, int>::iterator it;
-                               it = globaldata->gTreemap->seqsPerGroup.find("xxx");
-                               if (it == globaldata->gTreemap->seqsPerGroup.end()) { //its a new group
-                                       globaldata->gTreemap->namesOfGroups.push_back("xxx");
-                                       globaldata->gTreemap->seqsPerGroup["xxx"] = 1;
-                               }else {
-                                       globaldata->gTreemap->seqsPerGroup["xxx"]++;
-                               }
+                               //globaldata->gTreemap->namesOfSeqs.push_back(name);
+                               //globaldata->gTreemap->treemap[name].groupname = "xxx";
+                               //globaldata->gTreemap->treemap[name].vectorIndex = (globaldata->gTreemap->namesOfSeqs.size() - 1);
+                               
+                               //map<string, int>::iterator it;
+                               //it = globaldata->gTreemap->seqsPerGroup.find("xxx");
+                               //if (it == globaldata->gTreemap->seqsPerGroup.end()) { //its a new group
+                               //      globaldata->gTreemap->namesOfGroups.push_back("xxx");
+                               //      globaldata->gTreemap->seqsPerGroup["xxx"] = 1;
+                               //}else {
+                               //      globaldata->gTreemap->seqsPerGroup["xxx"]++;
+                               //}
                                
                                //find index in tree of name
-                               n1 = T->getIndex(name);
-                               group = "xxx";
+                               //n1 = T->getIndex(name);
+                               //group = "xxx";
+                               //numLeaves++;
+                               //numNodes = 2*numLeaves - 1;
                        }
                        
                        T->tree[n1].setGroup(group);
-               
                        T->tree[n1].setChildren(-1,-1);
                
                        if(blen == 1){