5 * Created by Sarah Westcott on 1/23/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
13 /****************************************************************/
15 m = MothurOut::getInstance();
26 /****************************************************************/
27 void Node::setName(string Name) { name = Name; }
28 /****************************************************************/
29 void Node::setGroup(vector<string> groups) { group =groups; }
30 /****************************************************************/
31 void Node::setBranchLength(float l) { branchLength = l; }
32 /****************************************************************/
33 void Node::setLabel(float l) { label = l; }
34 /****************************************************************/
35 void Node::setLengthToLeaves(float l) { length2leaf = l; }
36 /****************************************************************/
37 void Node::setParent(int p) { parent = p; }
38 /****************************************************************/
39 void Node::setIndex(int i) { vectorIndex = i; }
40 /****************************************************************/
41 void Node::setChildren(int lc, int rc) { lchild = lc; rchild = rc; } //leftchild, rightchild
42 /****************************************************************/
43 string Node::getName() { return name; }
44 /****************************************************************/
45 vector<string> Node::getGroup() { return group; }
46 /****************************************************************/
47 float Node::getBranchLength() { return branchLength; }
48 /****************************************************************/
49 float Node::getLabel() { return label; }
50 /****************************************************************/
51 float Node::getLengthToLeaves() { return length2leaf; }
52 /****************************************************************/
53 int Node::getParent() { return parent; }
54 /****************************************************************/
55 int Node::getLChild() { return lchild; }
56 /****************************************************************/
57 int Node::getRChild() { return rchild; }
58 /****************************************************************/
59 int Node::getIndex() { return vectorIndex; }
60 /****************************************************************/
61 //to be used by printTree in the Tree class to print the leaf info
62 void Node::printNode() {
64 m->mothurOut(name + " " + toString(parent) + " " + toString(lchild) + " " + toString(rchild) + " ");
66 /*for (int i = 0; i < group.size(); i++) { m->mothurOut( group[i] + " "); }
68 //there is a branch length
69 if (branchLength != -1) {
70 m->mothurOut(" " + toString(branchLength));
74 map<string, int>::iterator it;
75 for(it=pGroups.begin();it!=pGroups.end();it++){
76 m->mothurOut(" " + it->first + ":" + toString(it->second));
79 for(it=pcount.begin();it!=pcount.end();it++){
80 m->mothurOut(" " + it->first + ":" + toString(it->second));
82 m->mothurOutEndLine();
87 m->errorOut(e, "Node", "printNode");
91 /****************************************************************/