8 * Created by Sarah Westcott on 1/22/09.
9 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
24 #include "globaldata.hpp"
26 /* This class represents the treefile. */
30 Tree(); //to generate a tree from a file
34 void getCopy(Tree*); //makes tree a copy of the one passed in.
35 void assembleRandomTree();
36 void assembleRandomUnifracTree();
37 void createNewickFile();
39 void setIndex(string, int);
40 int getNumNodes() { return numNodes; }
41 int getNumLeaves(){ return numLeaves; }
43 //this function takes the leaf info and populates the non leaf nodes
46 vector<Node> tree; //the first n nodes are the leaves, where n is the number of sequences.
49 GlobalData* globaldata;
50 int numNodes, numLeaves;
54 map<string, int>::iterator it;
55 map<string, int> mergeGroups(int); //returns a map with a groupname and the number of times that group was seen in the children
56 map<string,int> Tree::mergeGcounts(int);
57 void randomTopology();
58 void randomBlengths();
60 int findRoot(); //return index of root node
61 void printBranch(int); //recursively print out tree