]> git.donarmstrong.com Git - mothur.git/blob - groupmap.h
fixed bug with displaying info for collect.shared() and summary.shared().
[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 <map>
13 #include <string>
14 #include <iostream>
15 #include <fstream>
16 #include "utilities.hpp"
17
18 /* This class is a representation of the groupfile.  It is used by all the shared commands to determine what group a 
19         certain sequence belongs to. */
20
21 class GroupMap {
22 public:
23         GroupMap(string);
24         ~GroupMap();
25         void readMap();
26         int getNumGroups();
27         string getGroup(string);
28         vector<string> namesOfGroups;
29         map<string, int> groupIndex;  //groupname, vectorIndex in namesOfGroups. - used by collectdisplays.
30                 
31 private:
32         ifstream fileHandle;
33         string groupFileName;
34         int numGroups, index;
35         map<string, string>::iterator it;
36         void setNamesOfGroups(string); 
37         map<string, string> groupmap; //sequence name and groupname
38 };
39
40 #endif