]> git.donarmstrong.com Git - mothur.git/blob - treemap.h
fixed summary.shared bug and set jumble default to 1.
[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 <Carbon/Carbon.h>
13 #include <map>
14 #include <string>
15 #include <iostream>
16 #include <fstream>
17 #include "utilities.hpp"
18
19 /* This class is used by the read.tree command to build the tree container. */
20
21 struct GroupIndex {
22         string  groupname;
23         int             vectorIndex;
24 };
25
26
27
28 class TreeMap {
29 public:
30         TreeMap(string);
31         ~TreeMap();
32         void readMap();
33         int getNumGroups();
34         int getNumSeqs();
35         void setIndex(string, int);  //sequencename, index
36         int getIndex(string);           //returns vector index of sequence
37         string getGroup(string);
38         vector<string> namesOfGroups;
39         vector<string> namesOfSeqs;
40         void print(ostream&);
41         
42 private:
43         ifstream fileHandle;
44         string groupFileName;
45         int numGroups;
46         map<string, GroupIndex>::iterator it;
47         void setNamesOfGroups(string); 
48         map<string, GroupIndex> treemap; //sequence name and groupname
49 };
50
51 #endif