+
+void FastaMap::readFastaFile(string inFileName) {
+ try {
+ ifstream in;
+ m->openInputFile(inFileName, in);
+ string name, sequence, line;
+ sequence = "";
+ string temp;
+ map<string, string>::iterator itName;
+
+
+ while(!in.eof()){
+ if (m->control_pressed) { break; }
+
+ Sequence currSeq(in);
+ 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(); }
+
+ 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 = name;
+ }else { // its a duplicate.
+ data[sequence].names += "," + name;
+ // data[sequence].groupnumber++;
+ }
+ }
+ m->gobble(in);
+ }
+ in.close();
+ }
+ catch(exception& e) {
+ m->errorOut(e, "FastaMap", "readFastaFile");
+ exit(1);
+ }
+}
+
+/*******************************************************************************/
+
+void FastaMap::readFastaFile(string inFastaFile, string oldNameFileName){ //prints data