X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=groupmap.h;h=a99ad119db44c2fd3bb6f78b696fc2d9ddf170af;hb=5f44783e6d74a9c207492ac244210c915cadc272;hp=263fc845b00f535d6d5db76e79d07470851b4481;hpb=60fdefb3a300b59c3bbeffdca8a5f1f30c6a43af;p=mothur.git diff --git a/groupmap.h b/groupmap.h index 263fc84..a99ad11 100644 --- a/groupmap.h +++ b/groupmap.h @@ -9,32 +9,35 @@ * */ -#include -#include -#include -#include -#include -#include "utilities.hpp" +#include "mothur.h" /* This class is a representation of the groupfile. It is used by all the shared commands to determine what group a certain sequence belongs to. */ class GroupMap { public: + GroupMap() {}; GroupMap(string); ~GroupMap(); - void readMap(); + int readMap(); int getNumGroups(); + bool isValidGroup(string); //return true if string is a valid group string getGroup(string); + void setGroup(string, string); vector namesOfGroups; - + map groupIndex; //groupname, vectorIndex in namesOfGroups. - used by collectdisplays and libshuff commands. + int getNumSeqs() { return groupmap.size(); } + vector getNamesSeqs(); + int getNumSeqs(string); //return the number of seqs in a given group + private: ifstream fileHandle; string groupFileName; - int numGroups; + int index; map::iterator it; void setNamesOfGroups(string); map groupmap; //sequence name and groupname + map seqsPerGroup; //maps groupname to number of seqs in that group }; -#endif \ No newline at end of file +#endif