]> git.donarmstrong.com Git - mothur.git/blobdiff - phylosummary.cpp
added load.logfile command. changed summary.single output for subsample=t.
[mothur.git] / phylosummary.cpp
index 2f565150aabeec35cc8a3c03a459d8b85090550b..5f7bbc3c73a2161417a1841f567719a4bd1f8c4a 100644 (file)
@@ -73,24 +73,16 @@ PhyloSummary::PhyloSummary(string groupFile){
 
 int PhyloSummary::summarize(string userTfile){
        try {
-               
-               ifstream in;
-               m->openInputFile(userTfile, in);
-               
-               //read in users taxonomy file and add sequences to tree
-               string name, tax;
-               int numSeqs = 0;
-               while(!in.eof()){
-                       in >> name >> tax; m->gobble(in);
-                       
-                       addSeqToTree(name, tax);
+               map<string, string> temp;
+        m->readTax(userTfile, temp);
+        
+        for (map<string, string>::iterator itTemp = temp.begin(); itTemp != temp.end();) {
+            addSeqToTree(itTemp->first, itTemp->second);
                        numSeqs++;
-                       
-                       if (m->control_pressed) { break;  }
-               }
-               in.close();
-               
-               return numSeqs;
+            temp.erase(itTemp++);
+        }
+        
+        return numSeqs;
        }
        catch(exception& e) {
                m->errorOut(e, "PhyloSummary", "summarize");