]> git.donarmstrong.com Git - mothur.git/blob - treemap.h
started shared utilities, updates to venn and heatmap added tree.groups command
[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 "mothur.h"
13 #include "groupmap.h"
14
15 /* This class is used by the read.tree command to build the tree container. */
16
17 struct GroupIndex {
18         string  groupname;
19         int             vectorIndex;
20 };
21
22 class GroupMap;
23
24 class TreeMap {
25 public:
26         TreeMap() {};
27         TreeMap(string);
28         ~TreeMap();
29         void readMap();
30         int getNumGroups();
31         int getNumSeqs();
32         void setIndex(string, int);  //sequencename, index
33         int getIndex(string);           //returns vector index of sequence
34         bool isValidGroup(string);  //return true if string is a valid group
35         string getGroup(string);
36         vector<string> namesOfGroups;
37         vector<string> namesOfSeqs;
38     map<string,int> seqsPerGroup;       //groupname, number of seqs in that group.
39         map<string, GroupIndex> treemap; //sequence name and <groupname, vector index>
40         void print(ostream&);
41         void makeSim(GroupMap*);  //takes groupmap info and fills treemap for use by tree.groups command.
42         
43         
44 private:
45         ifstream fileHandle;
46         string groupFileName;
47         int numGroups;
48         map<string, GroupIndex>::iterator it;
49         map<string, int>::iterator it2;
50         void setNamesOfGroups(string); 
51         
52         
53 };
54
55 #endif