]> git.donarmstrong.com Git - mothur.git/blob - treemap.h
fixed parsimony for groups
[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 "utilities.hpp"
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
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         
42         
43 private:
44         ifstream fileHandle;
45         string groupFileName;
46         int numGroups;
47         map<string, GroupIndex>::iterator it;
48         map<string, int>::iterator it2;
49         void setNamesOfGroups(string); 
50         
51         
52 };
53
54 #endif