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