3 #include "nameassignment.hpp"
5 //**********************************************************************************************************************
7 NameAssignment::NameAssignment(string nameMapFile){
9 openInputFile(nameMapFile, fileHandle);
13 //**********************************************************************************************************************
15 void NameAssignment::readMap(){
17 string firstCol, secondCol, skip;
21 // map<string, string> data;
25 fileHandle >> firstCol; //read from first column
26 fileHandle >> secondCol; //read from second column
28 // data[firstCol] = secondCol; //store data in map
30 list.push_back(secondCol); //adds data's value to list
31 (*this)[firstCol] = rowIndex++;
38 errorOut(e, "NameAssignment", "readMap");
43 //**********************************************************************************************************************
45 ListVector NameAssignment::getListVector(void){
51 //**********************************************************************************************************************
53 void NameAssignment::print(void){
55 map<string,int>::iterator it;
56 for(it = (*this).begin(); it!=(*this).end(); it++){
57 mothurOut(it->first + "\t" + toString(it->second)); mothurOutEndLine(); //prints out keys and values of the map this.
61 errorOut(e, "NameAssignment", "print");
66 //**********************************************************************************************************************
68 int NameAssignment::get(string key){
74 //**********************************************************************************************************************