8 * Created by Sarah Westcott on 1/23/09.
9 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
14 #include "mothurout.h"
16 /* This class represents a node on a tree. */
21 Node(); //pass it the sequence name
22 ~Node() { pGroups.clear(); pcount.clear(); };
25 void setGroup(vector<string>);
26 void setBranchLength(float);
29 void setChildren(int, int); //leftchild, rightchild
31 void setLengthToLeaves(float);
34 vector<string> getGroup();
35 float getBranchLength();
36 float getLengthToLeaves();
42 void printNode(); //prints out the name and the branch length
45 //pGroup is the parsimony group info. i.e. for a leaf node it would contain 1 enter pGroup["groupname"] = 1;
46 //but for a branch node it may contain several entries so if the nodes children are from different groups it
47 //would have at least two entries pgroup["groupnameOfLeftChild"] = 1, pgroup["groupnameOfRightChild"] = 1.
48 //pCount is the nodes descendant group infomation. i.e. pCount["black"] = 20 would mean that 20 of the nodes
49 //descendant are from group black.
51 map<string, int> pGroups; //leaf nodes will only have 1 group, but branch nodes may have multiple groups.
52 map<string, int> pcount;
57 float branchLength, length2leaf, label;