]> git.donarmstrong.com Git - mothur.git/blob - treemap.h
When Pat tried to compile mothur in Ubuntu linux, there were a number of minor proble...
[mothur.git] / treemap.h
1 #ifndef TREEMAP_H
2 #define TREEMAP_H
3 /*
4  *  treemap.h
5  *  Mothur
6  *
7  *  Created by Sarah Westcott on 1/26/09.
8  *  Copyright 2009 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 used by the read.tree command to build the tree container. */
19
20 struct GroupIndex {
21         string  groupname;
22         int             vectorIndex;
23 };
24
25
26
27 class TreeMap {
28 public:
29         TreeMap(string);
30         ~TreeMap();
31         void readMap();
32         int getNumGroups();
33         int getNumSeqs();
34         void setIndex(string, int);  //sequencename, index
35         int getIndex(string);           //returns vector index of sequence
36         string getGroup(string);
37         vector<string> namesOfGroups;
38         vector<string> namesOfSeqs;
39         void print(ostream&);
40         
41 private:
42         ifstream fileHandle;
43         string groupFileName;
44         int numGroups;
45         map<string, GroupIndex>::iterator it;
46         void setNamesOfGroups(string); 
47         map<string, GroupIndex> treemap; //sequence name and groupname
48 };
49
50 #endif