]> git.donarmstrong.com Git - mothur.git/blobdiff - mothurout.cpp
added namefile to align.check and added seqs from namefile to optimizing piece of...
[mothur.git] / mothurout.cpp
index 27b36ce5ff83dceadeb77e84045caef94d5168c9..96e7bb83e168a335472d77e9dae77359d2889951 100644 (file)
@@ -1096,6 +1096,36 @@ float MothurOut::ceilDist(float dist, int precision){
                exit(1);
        }
 }
+/**********************************************************************************************************************/
+map<string, int> MothurOut::readNames(string namefile) { 
+       try {
+               
+               map<string, int> nameMap;
+               
+               //open input file
+               ifstream in;
+               openInputFile(namefile, in);
+               
+               while (!in.eof()) {
+                       if (control_pressed) { break; }
+                       
+                       string firstCol, secondCol;
+                       in >> firstCol >> secondCol; gobble(in);
+                       
+                       int num = getNumNames(secondCol);
+                       
+                       nameMap[firstCol] = num;
+               }
+               in.close();
+               
+               return nameMap;
+               
+       }
+       catch(exception& e) {
+               errorOut(e, "MothurOut", "readNames");
+               exit(1);
+       }
+}
 
 /***********************************************************************/