]> git.donarmstrong.com Git - mothur.git/blobdiff - nameassignment.cpp
This is v.1.4.0
[mothur.git] / nameassignment.cpp
index 21703e43fa965b4d8a6cc9dedf055c2ea406466e..cf4e6774c32706d506d472963bda6f9ac86df7f1 100644 (file)
@@ -12,37 +12,33 @@ NameAssignment::NameAssignment(string nameMapFile){
 
 //**********************************************************************************************************************
 
-void NameAssignment::readMap(int colA, int colB){
+void NameAssignment::readMap(){
        try{
                string firstCol, secondCol, skip;
        //      int index = 0;
        
-               int skipNCols = colB-colA-1;
-       
-               map<string, string> data;
        
+//             map<string, string> data;
+               int rowIndex = 0;
+
                while(fileHandle){
                        fileHandle >> firstCol;                         //read from first column
-               
-                       for(int i=0;i<skipNCols;i++){           //allows for anticipated file format
-                               fileHandle >> skip;
-                       }
-               
                        fileHandle >> secondCol;                        //read from second column
-               
-                       data[firstCol] = secondCol;                     //store data in map
-               
+                       
+//                     data[firstCol] = secondCol;                     //store data in map
+
+                       list.push_back(secondCol);              //adds data's value to list
+                       (*this)[firstCol] = rowIndex++;
                        gobble(fileHandle);
                }
                fileHandle.close();
        
-               int rowIndex = 0;
-               map<string, string>::iterator it = data.begin();
-               for(it;it!=data.end();it++){
-                       list.push_back(it->second);             //adds data's value to list
-                       (*this)[it->first] = rowIndex;
-                       rowIndex++;
-               }
+//             map<string, string>::iterator it = data.begin();
+//             for(it;it!=data.end();it++){
+//                     cout << it->first << endl;
+//                     (*this)[it->first] = rowIndex;
+//                     rowIndex++;
+//             }
        }
        catch(exception& e) {
                cout << "Standard Error: " << e.what() << " has occurred in the NameAssignment class Function readMap. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";