]> git.donarmstrong.com Git - mothur.git/blobdiff - mothurout.cpp
added summary.tax command and fixed bug with root level totals in tax.summary file
[mothur.git] / mothurout.cpp
index 45d1176f9ddafeee56b219529efed45ea3d19d02..df1a1c0615be21cd53ab51b0a82cfaab3871e847 100644 (file)
@@ -1349,7 +1349,35 @@ int MothurOut::readNames(string namefile, map<string, string>& nameMap) {
                exit(1);
        }
 }
-
+/**********************************************************************************************************************/
+int MothurOut::readNames(string namefile, map<string, vector<string> >& nameMap) { 
+       try {
+               
+               //open input file
+               ifstream in;
+               openInputFile(namefile, in);
+               
+               while (!in.eof()) {
+                       if (control_pressed) { break; }
+                       
+                       string firstCol, secondCol;
+                       in >> firstCol >> secondCol; gobble(in);
+                       
+                       vector<string> temp;
+                       splitAtComma(secondCol, temp);
+                       
+                       nameMap[firstCol] = temp;
+               }
+               in.close();
+               
+               return 0;
+               
+       }
+       catch(exception& e) {
+               errorOut(e, "MothurOut", "readNames");
+               exit(1);
+       }
+}
 /**********************************************************************************************************************/
 map<string, int> MothurOut::readNames(string namefile) { 
        try {