X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=treenode.h;h=a5c39167ca6bda64c8058e99b16a02ca4e07c748;hb=9651e8e7172d86707b34af15e95ec60ad4c3c3f9;hp=8bd055931be0ead0d8dc8a2c08d9f8e9ba637aba;hpb=58cf1d08fee8c64334979075fa57bcafb035a2ed;p=mothur.git diff --git a/treenode.h b/treenode.h index 8bd0559..a5c3916 100644 --- a/treenode.h +++ b/treenode.h @@ -12,11 +12,7 @@ using namespace std; -#include -#include -#include -#include -#include +#include "mothur.h" /* This class represents a node on a tree. */ @@ -27,25 +23,34 @@ class Node { ~Node() {}; void setName(string); - void setGroup(string); //non leaf nodes will belong to multiple groups, leaf nodes will only belong to one. + void setGroup(string); void setBranchLength(float); void setParent(int); void setChildren(int, int); //leftchild, rightchild void setIndex(int); string getName(); - vector getGroup(); //leaf nodes will only have 1 group, but branch nodes may have multiple groups. + string getGroup(); float getBranchLength(); int getParent(); int getLChild(); int getRChild(); int getIndex(); + void printNode(); //prints out the name and the branch length - void printNode(ostream&); //prints out the name and the branch length + //pGroup is the parsimony group info. i.e. for a leaf node it would contain 1 enter pGroup["groupname"] = 1; + //but for a branch node it may contain several entries so if the nodes children are from different groups it + //would have at least two entries pgroup["groupnameOfLeftChild"] = 1, pgroup["groupnameOfRightChild"] = 1. + //pCount is the nodes descendant group infomation. i.e. pCount["black"] = 20 would mean that 20 of the nodes + //descendant are from group black. + + map pGroups; //leaf nodes will only have 1 group, but branch nodes may have multiple groups. + map pcount; + private: string name; - vector group; + string group; float branchLength; int parent; int lchild;