X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=groupmap.cpp;fp=groupmap.cpp;h=481fd1decfc4516eb5e1cf618c6b4d40cffbc8a9;hb=55386dddad84cc1140d736cabaf4dd0ae16f2e01;hp=58e04c5db858791f28a99a5cb50795a570da0690;hpb=990ded2eb38078a417fa00b4fbb4d3c24f4b5046;p=mothur.git diff --git a/groupmap.cpp b/groupmap.cpp index 58e04c5..481fd1d 100644 --- a/groupmap.cpp +++ b/groupmap.cpp @@ -44,7 +44,7 @@ int GroupMap::readMap() { m->gobble(fileHandle); } fileHandle.close(); - m->namesOfGroups = namesOfGroups; + m->setAllGroups(namesOfGroups); return error; } /************************************************************/ @@ -70,7 +70,7 @@ int GroupMap::readDesignMap() { m->gobble(fileHandle); } fileHandle.close(); - m->namesOfGroups = namesOfGroups; + m->setAllGroups(namesOfGroups); return error; } @@ -91,7 +91,15 @@ string GroupMap::getGroup(string sequenceName) { /************************************************************/ 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 + } } /************************************************************/