X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=groupmap.h;h=d0e43c5b16a8989786146ec2026b18bbd86c8121;hb=2e77272b6f5987bd2bde592bb15262a8c69ea9e0;hp=de69ca4d94c5e98342c666c7de0a768f61a3b267;hpb=09a01fb51eea9e81409d367410c831394193fd86;p=mothur.git diff --git a/groupmap.h b/groupmap.h index de69ca4..d0e43c5 100644 --- a/groupmap.h +++ b/groupmap.h @@ -9,11 +9,8 @@ * */ -#include -#include -#include -#include -#include "utilities.hpp" +#include "mothur.h" +#include "mothurout.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. */ @@ -23,20 +20,27 @@ public: GroupMap() {}; GroupMap(string); ~GroupMap(); - void readMap(); + int readMap(); + int readDesignMap(); 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. - + 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: + MothurOut* m; ifstream fileHandle; string groupFileName; 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