- if(currSeq.getIsAligned()) { sequence = currSeq.getAligned(); }
- else { sequence = currSeq.getUnaligned(); }
-
- 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++;
- }
-
- gobble(inFASTA);
+ 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);