7 * Created by Sarah Westcott on 12/1/08.
8 * Copyright 2008 Schloss Lab UMASS Amherst. All rights reserved.
13 #include "mothurout.h"
15 /* This class is a representation of the groupfile. It is used by all the shared commands to determine what group a
16 certain sequence belongs to. */
20 GroupMap() { m = MothurOut::getInstance(); }
25 int readDesignMap(string);
27 bool isValidGroup(string); //return true if string is a valid group
28 string getGroup(string);
29 void setGroup(string, string);
30 vector<string> getNamesOfGroups() {
31 sort(namesOfGroups.begin(), namesOfGroups.end());
33 for (int i = 0; i < namesOfGroups.size(); i++) { groupIndex[namesOfGroups[i]] = i; }
36 void setNamesOfGroups(vector<string> sn) { namesOfGroups = sn; }
37 map<string, int> groupIndex; //groupname, vectorIndex in namesOfGroups. - used by collectdisplays and libshuff commands.
38 int getNumSeqs() { return groupmap.size(); }
39 vector<string> getNamesSeqs();
40 vector<string> getNamesSeqs(vector<string>); //get names of seqs belonging to a group or set of groups
41 int getNumSeqs(string); //return the number of seqs in a given group
44 vector<string> namesOfGroups;
49 map<string, string>::iterator it;
50 void setNamesOfGroups(string);
51 map<string, string> groupmap; //sequence name and groupname
52 map<string, int> seqsPerGroup; //maps groupname to number of seqs in that group