]> git.donarmstrong.com Git - mothur.git/blobdiff - phylosummary.cpp
classify.seqs summary file fix
[mothur.git] / phylosummary.cpp
index 870f35fa3b994a78ed165d1179c8ee2d6daf207b..4e94605e47caf6e09d099a4df32dfdd7677be676 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);
                        
@@ -117,15 +117,15 @@ int PhyloSummary::addSeqToTree(string seqName, string seqTaxonomy){
                                        if (group == "not found") {  m->mothurOut(seqName + " is not in your groupfile, and will be included in the overall total, but not any group total."); m->mothurOutEndLine();  }
                                        
                                        //do you have a count for this group?
-                                       map<string, int>::iterator itGroup = tree[currentNode].groupCount.find(group);
+                                       map<string, int>::iterator itGroup = tree[childPointer->second].groupCount.find(group);
                                        
                                        //if yes, increment it - there should not be a case where we can't find it since we load group in read
-                                       if (itGroup != tree[currentNode].groupCount.end()) {
-                                               tree[currentNode].groupCount[group]++;
+                                       if (itGroup != tree[childPointer->second].groupCount.end()) {
+                                               tree[childPointer->second].groupCount[group]++;
                                        }
                                }
                                
-                               tree[currentNode].total++;
+                               tree[childPointer->second].total++;
 
                                currentNode = childPointer->second;
                        }else{  //otherwise, error
@@ -252,15 +252,15 @@ void PhyloSummary::readTreeStruct(ifstream& in){
        try {
        
                //read version
-               string line = getline(in); gobble(in);
+               string line = m->getline(in); m->gobble(in);
                
                int num;
                
-               in >> num; gobble(in);
+               in >> num; m->gobble(in);
                
                tree.resize(num);
                
-               in >> maxLevel; gobble(in);
+               in >> maxLevel; m->gobble(in);
        
                //read the tree file
                for (int i = 0; i < tree.size(); i++) {
@@ -284,7 +284,7 @@ void PhyloSummary::readTreeStruct(ifstream& in){
                        
                        tree[i].total = 0;
                        
-                       gobble(in);
+                       m->gobble(in);
                        
                        //if (tree[i].level > maxLevel) {  maxLevel = tree[i].level;  }
                }