]> git.donarmstrong.com Git - mothur.git/blob - tree.h
fixed summary.shared bug and set jumble default to 1.
[mothur.git] / tree.h
1 #ifndef TREE_H
2 #define TREE_H
3
4 /*
5  *  tree.h
6  *  Mothur
7  *
8  *  Created by Sarah Westcott on 1/22/09.
9  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10  *
11  */
12
13 using namespace std;
14
15 #include <string>
16 #include <iostream>
17 #include <vector>
18 #include "treenode.h"
19 #include "globaldata.hpp"
20
21 /* This class represents the treefile. */
22
23
24
25 class Tree {
26         public: 
27                 Tree();  
28                 ~Tree() {};
29                 
30                 Tree generateRandomTree();
31                 void createNewickFile();
32                 int getIndex(string);
33                 void setIndex(string, int);
34                 int getNumNodes() { return numNodes; }
35                 int getNumLeaves(){     return numLeaves;}
36                 vector<Node> tree;              //the first n nodes are the leaves, where n is the number of sequences.
37                 
38         private:
39                 GlobalData* globaldata;
40                 int findRoot();  //return index of root node
41                 void printBranch(int);  //recursively print out tree
42                 int numNodes, numLeaves;
43                 ofstream out;
44                 string filename;
45 };
46
47
48
49
50 #endif