+}
+
+/*******************************************************************************/
+
+void FastaMap::readFastaFile(string inFastaFile, string oldNameFileName){ //prints data
+
+ ifstream oldNameFile;
+ m->openInputFile(oldNameFileName, oldNameFile);
+
+ map<string,string> oldNameMap;
+ map<string, string>::iterator itName;
+ string name, list;
+ while(!oldNameFile.eof()){
+ if (m->control_pressed) { break; }
+
+ oldNameFile >> name; m->gobble(oldNameFile);
+ oldNameFile >> list;
+ oldNameMap[name] = list;
+ m->gobble(oldNameFile);
+ }
+ oldNameFile.close();
+
+ ifstream inFASTA;
+ m->openInputFile(inFastaFile, inFASTA);
+ string sequence;
+ while(!inFASTA.eof()){
+ if (m->control_pressed) { break; }
+
+ Sequence currSeq(inFASTA);
+ name = currSeq.getName();
+
+ if (name != "") {
+ if(currSeq.getIsAligned()) { sequence = currSeq.getAligned(); }
+ else { sequence = currSeq.getUnaligned(); }
+
+ itName = seqmap.find(name);
+ if (itName == seqmap.end()) { seqmap[name] = sequence; }
+ else { m->mothurOut("You already have a sequence named " + name + ", sequence names must be unique, please correct."); m->mothurOutEndLine(); }
+
+ seqmap[name] = sequence;
+ map<string,group>::iterator it = data.find(sequence);
+ if (it == data.end()) { //it's unique.
+ data[sequence].groupname = name; //group name will be the name of the first duplicate sequence found.
+ // data[sequence].groupnumber = 1;
+ data[sequence].names = oldNameMap[name];
+ }else { // its a duplicate.
+ data[sequence].names += "," + oldNameMap[name];
+ // data[sequence].groupnumber++;
+ }
+ }
+ m->gobble(inFASTA);