5 * Created by Sarah Westcott on 1/23/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
13 /****************************************************************/
24 /****************************************************************/
25 void Node::setName(string Name) { name = Name; }
26 /****************************************************************/
27 void Node::setGroup(string groups) { group =groups; }
28 /****************************************************************/
29 void Node::setBranchLength(float l) { branchLength = l; }
30 /****************************************************************/
31 void Node::setLengthToLeaves(float l) { length2leaf = l; }
32 /****************************************************************/
33 void Node::setParent(int p) { parent = p; }
34 /****************************************************************/
35 void Node::setIndex(int i) { vectorIndex = i; }
36 /****************************************************************/
37 void Node::setChildren(int lc, int rc) { lchild = lc; rchild = rc; } //leftchild, rightchild
38 /****************************************************************/
39 string Node::getName() { return name; }
40 /****************************************************************/
41 string Node::getGroup() { return group; }
42 /****************************************************************/
43 float Node::getBranchLength() { return branchLength; }
44 /****************************************************************/
45 float Node::getLengthToLeaves() { return length2leaf; }
46 /****************************************************************/
47 int Node::getParent() { return parent; }
48 /****************************************************************/
49 int Node::getLChild() { return lchild; }
50 /****************************************************************/
51 int Node::getRChild() { return rchild; }
52 /****************************************************************/
53 int Node::getIndex() { return vectorIndex; }
54 /****************************************************************/
55 //to be used by printTree in the Tree class to print the leaf info
56 void Node::printNode() {
58 cout << parent << ' ' << lchild << ' ' << rchild << ' ' << group;
59 //there is a branch length
60 if (branchLength != -1) {
61 cout << ' ' << setprecision(4) << branchLength;
64 map<string, int>::iterator it;
65 for(it=pGroups.begin();it!=pGroups.end();it++){
66 cout << ' ' << it->first << ':' << it->second;
69 for(it=pcount.begin();it!=pcount.end();it++){
70 cout << ' ' << it->first << ':' << it->second;
77 cout << "Standard Error: " << e.what() << " has occurred in the Node class Function printNode. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
81 cout << "An unknown error has occurred in the Node class function printNode. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
85 /****************************************************************/