X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=groupmap.cpp;h=58e04c5db858791f28a99a5cb50795a570da0690;hb=47af4126c6ece121172cd486c1ca7eeb1ccae2de;hp=f6705e53db2048691b95050f3005bdccecf21347;hpb=8c616f2509abd2fb9485a38607c1b439d243b85c;p=mothur.git diff --git a/groupmap.cpp b/groupmap.cpp index f6705e5..58e04c5 100644 --- a/groupmap.cpp +++ b/groupmap.cpp @@ -44,6 +44,7 @@ int GroupMap::readMap() { m->gobble(fileHandle); } fileHandle.close(); + m->namesOfGroups = namesOfGroups; return error; } /************************************************************/ @@ -69,6 +70,7 @@ int GroupMap::readDesignMap() { m->gobble(fileHandle); } fileHandle.close(); + m->namesOfGroups = namesOfGroups; return error; } @@ -161,4 +163,25 @@ vector GroupMap::getNamesSeqs(){ } } /************************************************************/ +vector GroupMap::getNamesSeqs(vector picked){ + try { + + vector names; + + for (it = groupmap.begin(); it != groupmap.end(); it++) { + //if you are belong to one the the groups in the picked vector add you + if (m->inUsersGroups(it->second, picked)) { + names.push_back(it->first); + } + } + + return names; + } + catch(exception& e) { + m->errorOut(e, "GroupMap", "getNamesSeqs"); + exit(1); + } +} + +/************************************************************/