X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tree.h;h=1c44d8c919805c24072e0f6ab314789393ed63ce;hb=f09bacac01a842a74c1c1b69070852cc969ff506;hp=c90f51a451461ceca068f743ecefe8fd3e7cba5f;hpb=ac1da2a793271cb67f2a2155c5558e1fabdd6aba;p=mothur.git diff --git a/tree.h b/tree.h index c90f51a..1c44d8c 100644 --- a/tree.h +++ b/tree.h @@ -18,6 +18,7 @@ class GlobalData; class Tree { public: + Tree(string); Tree(); //to generate a tree from a file ~Tree(); @@ -37,9 +38,12 @@ public: int findRoot(); //return index of root node //this function takes the leaf info and populates the non leaf nodes - void assembleTree(); + int assembleTree(); + int assembleTree(string); vector tree; //the first n nodes are the leaves, where n is the number of sequences. + map< string, vector > groupNodeInfo; //maps group to indexes of leaf nodes with that group, different groups may contain same node because of names file. + private: GlobalData* globaldata; int numNodes, numLeaves; @@ -48,18 +52,22 @@ private: map::iterator it, it2; map mergeGroups(int); //returns a map with a groupname and the number of times that group was seen in the children - map mergeGcounts(int); + + void addNamesToCounts(); void randomTopology(); void randomBlengths(); void randomLabels(vector); - void randomLabels(string, string); + //void randomLabels(string, string); void printBranch(int, ostream&, string); //recursively print out tree void parseTreeFile(); //parses through tree file to find names of nodes and number of them //this is required in case user has sequences in the names file that are //not included in the tree. //only takes names from the first tree in the tree file and assumes that all trees use the same names. int readTreeString(ifstream&); + + MothurOut* m; + }; #endif