]> git.donarmstrong.com Git - mothur.git/blobdiff - phylosummary.cpp
fixed cluster.classic and added weighted method to hcluster
[mothur.git] / phylosummary.cpp
index 33396975f506626ff275a8c37fa6c0f83a3ead18..39bfdf3dfecb1cd4aaecb2763043d0c8cbb00d29 100644 (file)
@@ -48,12 +48,12 @@ void PhyloSummary::summarize(string userTfile){
        try {
                
                ifstream in;
-               openInputFile(userTfile, in);
+               m->openInputFile(userTfile, in);
                
                //read in users taxonomy file and add sequences to tree
                string name, tax;
                while(!in.eof()){
-                       in >> name >> tax; gobble(in);
+                       in >> name >> tax; m->gobble(in);
                        
                        addSeqToTree(name, tax);
                        
@@ -250,11 +250,17 @@ void PhyloSummary::print(int i, ofstream& out){
 /**************************************************************************************************/
 void PhyloSummary::readTreeStruct(ifstream& in){
        try {
+       
+               //read version
+               string line = m->getline(in); m->gobble(in);
+               
                int num;
                
-               in >> num; gobble(in);
+               in >> num; m->gobble(in);
                
                tree.resize(num);
+               
+               in >> maxLevel; m->gobble(in);
        
                //read the tree file
                for (int i = 0; i < tree.size(); i++) {
@@ -278,9 +284,9 @@ void PhyloSummary::readTreeStruct(ifstream& in){
                        
                        tree[i].total = 0;
                        
-                       gobble(in);
+                       m->gobble(in);
                        
-                       if (tree[i].level > maxLevel) {  maxLevel = tree[i].level;  }
+                       //if (tree[i].level > maxLevel) {  maxLevel = tree[i].level;  }
                }
 
        }