]> git.donarmstrong.com Git - mothur.git/blob - groupmap.h
added design parameter to the indicator command
[mothur.git] / groupmap.h
1 #ifndef GROUPMAP_H
2 #define GROUPMAP_H
3 /*
4  *  groupmap.h
5  *  Dotur
6  *
7  *  Created by Sarah Westcott on 12/1/08.
8  *  Copyright 2008 Schloss Lab UMASS Amherst. All rights reserved.
9  *
10  */
11
12 #include "mothur.h"
13 #include "mothurout.h"
14
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. */
17
18 class GroupMap {
19 public:
20         GroupMap() {};
21         GroupMap(string);
22         ~GroupMap();
23         int readMap();
24         int readDesignMap();
25         int getNumGroups();
26         bool isValidGroup(string);  //return true if string is a valid group
27         string getGroup(string);
28         void setGroup(string, string);
29         vector<string> namesOfGroups;
30         map<string, int> groupIndex;  //groupname, vectorIndex in namesOfGroups. - used by collectdisplays and libshuff commands.
31         int getNumSeqs()  {  return groupmap.size();  }
32         vector<string> getNamesSeqs();
33         vector<string> getNamesSeqs(vector<string>); //get names of seqs belonging to a group or set of groups
34         int getNumSeqs(string); //return the number of seqs in a given group
35                         
36 private:
37         MothurOut* m;
38         ifstream fileHandle;
39         string groupFileName;
40         int index;
41         map<string, string>::iterator it;
42         void setNamesOfGroups(string); 
43         map<string, string> groupmap; //sequence name and groupname
44         map<string, int> seqsPerGroup;  //maps groupname to number of seqs in that group
45 };
46
47 #endif