+ m->errorOut(e, "ReadTreeCommand", "execute");
+ exit(1);
+ }
+}
+/*****************************************************************/
+int ReadTreeCommand::readNamesFile() {
+ try {
+ globaldata->names.clear();
+
+ ifstream in;
+ openInputFile(namefile, in);
+
+ string first, second;
+ map<string, string>::iterator itNames;
+
+ while(!in.eof()) {
+ in >> first >> second; gobble(in);
+
+ itNames = globaldata->names.find(first);
+ if (itNames == globaldata->names.end()) {
+ globaldata->names[first] = second;
+
+ //we need a list of names in your namefile to use above when removing extra seqs above so we don't remove them
+ vector<string> dupNames;
+ splitAtComma(second, dupNames);
+
+ for (int i = 0; i < dupNames.size(); i++) { nameMap[dupNames[i]] = dupNames[i]; }
+ }else { m->mothurOut(first + " has already been seen in namefile, disregarding names file."); m->mothurOutEndLine(); in.close(); globaldata->names.clear(); return 1; }
+ }
+ in.close();
+
+ return 0;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ReadTreeCommand", "readNamesFile");