]> git.donarmstrong.com Git - mothur.git/blobdiff - tree.h
fixed summary.shared bug and set jumble default to 1.
[mothur.git] / tree.h
diff --git a/tree.h b/tree.h
index 9dee24d2eec051428b9cbb977042a91195cca5f5..63c7d5f5cdc2a170e2eef909565842dcbf1fcef2 100644 (file)
--- a/tree.h
+++ b/tree.h
@@ -15,37 +15,33 @@ using namespace std;
 #include <string>
 #include <iostream>
 #include <vector>
+#include "treenode.h"
+#include "globaldata.hpp"
 
-struct Node  {
-               string  name;
-               string  group;
-               float   branchLength;
-               Node*   parent;
-               Node*   lchild;
-               Node*   rchild;
-};             
+/* This class represents the treefile. */
 
 
 
 class Tree {
        public: 
-               Tree();
-               ~Tree();
-               
-               Node* getParent(Node);
-               Node* getLChild(Node);
-               Node* getRChild(Node);
-               
-               void setParent(Node);
-               void setLChild(Node);
-               void setRChild(Node);
-               
+               Tree();  
+               ~Tree() {};
                
                Tree generateRandomTree();
-               
-               vector<Node> leaves;            //gives you easy access to the leaves of the tree to generate the parsimony score
+               void createNewickFile();
+               int getIndex(string);
+               void setIndex(string, int);
+               int getNumNodes() { return numNodes; }
+               int getNumLeaves(){     return numLeaves;}
+               vector<Node> tree;              //the first n nodes are the leaves, where n is the number of sequences.
                
        private:
+               GlobalData* globaldata;
+               int findRoot();  //return index of root node
+               void printBranch(int);  //recursively print out tree
+               int numNodes, numLeaves;
+               ofstream out;
+               string filename;
 };