m->gobble(fileHandle);
}
fileHandle.close();
- m->namesOfGroups = namesOfGroups;
+ m->setAllGroups(namesOfGroups);
return error;
}
/************************************************************/
m->gobble(fileHandle);
}
fileHandle.close();
- m->namesOfGroups = namesOfGroups;
+ m->setAllGroups(namesOfGroups);
return error;
}
/************************************************************/
void GroupMap::setGroup(string sequenceName, string groupN) {
- groupmap[sequenceName] = groupN;
+ setNamesOfGroups(groupN);
+
+ it = groupmap.find(sequenceName);
+
+ if (it != groupmap.end()) { m->mothurOut("Your groupfile contains more than 1 sequence named " + sequenceName + ", sequence names must be unique. Please correct."); m->mothurOutEndLine(); }
+ else {
+ groupmap[sequenceName] = groupN; //store data in map
+ seqsPerGroup[groupN]++; //increment number of seqs in that group
+ }
}
/************************************************************/