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(vector<string>);
29 void assembleRandomUnifracTree(string, string);
30 void createNewickFile(string);
32 void setIndex(string, int);
33 int getNumNodes() { return numNodes; }
34 int getNumLeaves(){ return numLeaves; }
35 map<string, int> mergeUserGroups(int, vector<string>); //returns a map with a groupname and the number of times that group was seen in the children
38 void printForBoot(ostream&);
40 //this function takes the leaf info and populates the non leaf nodes
43 vector<Node> tree; //the first n nodes are the leaves, where n is the number of sequences.
45 GlobalData* globaldata;
46 int numNodes, numLeaves;
50 map<string, int>::iterator it, it2;
51 map<string, int> mergeGroups(int); //returns a map with a groupname and the number of times that group was seen in the children
53 map<string,int> mergeGcounts(int);
54 void randomTopology();
55 void randomBlengths();
56 void randomLabels(vector<string>);
57 void randomLabels(string, string);
58 int findRoot(); //return index of root node
59 void printBranch(int, ostream&, string); //recursively print out tree