]> git.donarmstrong.com Git - mothur.git/blob - groupmap.h
added check for blank files in openInputFile, add check for groupfiles that contain...
[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
14 /* This class is a representation of the groupfile.  It is used by all the shared commands to determine what group a 
15         certain sequence belongs to. */
16
17 class GroupMap {
18 public:
19         GroupMap() {};
20         GroupMap(string);
21         ~GroupMap();
22         void readMap();
23         int getNumGroups();
24         bool isValidGroup(string);  //return true if string is a valid group
25         string getGroup(string);
26         void setGroup(string, string);
27         vector<string> namesOfGroups;
28         map<string, int> groupIndex;  //groupname, vectorIndex in namesOfGroups. - used by collectdisplays.
29         int getNumSeqs()  {  return groupmap.size();  }
30                         
31 private:
32         ifstream fileHandle;
33         string groupFileName;
34         int index;
35         map<string, string>::iterator it;
36         void setNamesOfGroups(string); 
37         map<string, string> groupmap; //sequence name and groupname
38 };
39
40 #endif