Commit bf5c996a authored by omid's avatar omid
Browse files

More changes on the final tree report

parent 57979c06
......@@ -258,7 +258,7 @@ void Newick::printTreeUnformatted(std::ostream &aOut, TreeNode *aNode) const {
}
int Newick::printTreeAnnotated(std::ostream &aOut, TreeNode *aNode, int aBranch,
bool wLeaves) const {
bool wLeaves, bool bNumber) const {
TreeNode *m;
unsigned int idx;
int branch_idx = aBranch;
......@@ -266,10 +266,10 @@ int Newick::printTreeAnnotated(std::ostream &aOut, TreeNode *aNode, int aBranch,
// Special case for the root
if (!aNode) {
if (wLeaves)
aOut << "Annotated Newick Tree (*N marks the branch N)" << std::endl;
aOut << "Annotated Newick Tree (*N marks the branch N)" << std::endl << std::endl;
else
aOut << "Annotated Newick Tree (*N marks the internal branch N)"
<< std::endl;
<< std::endl << std::endl;
aOut << '(';
for (idx = 0; (m = mTreeRoot.getChild(idx)) != NULL; ++idx) {
if (idx > 0)
......@@ -284,7 +284,7 @@ int Newick::printTreeAnnotated(std::ostream &aOut, TreeNode *aNode, int aBranch,
if (wLeaves)
branch_idx = aBranch + 1;
aNode->printNode();
if (wLeaves)
if (wLeaves and bNumber)
aOut << '*' << aBranch;
} else {
branch_idx = aBranch + 1;
......@@ -296,7 +296,7 @@ int Newick::printTreeAnnotated(std::ostream &aOut, TreeNode *aNode, int aBranch,
}
aOut << ')';
aNode->printNode();
aOut << '*' << aBranch;
if (bNumber) aOut << '*' << aBranch;
}
return branch_idx;
......
......@@ -67,7 +67,7 @@ public:
///
virtual int printTreeAnnotated(std::ostream &aOut, TreeNode *aNode = NULL,
int aInternalBranch = 0,
bool wLeaves = false) const;
bool wLeaves = false, bool bNumber=true) const;
/// Print the phylogenetic tree completed with all the info loaded in the same
/// format as read in and annotated with the branch numbers.
......
......@@ -617,6 +617,7 @@ int main(int aRgc, char **aRgv) {
if (cmd.mVerboseLevel >= VERBOSE_ONLY_RESULTS) {
std::cout << std::endl << "Final ";
tree.printTreeAnnotated(std::cout, NULL, 0, true);
tree.printTreeAnnotated(std::cout, NULL, 0, true, false);
}
}
......@@ -853,6 +854,7 @@ int main(int aRgc, char **aRgv) {
if (cmd.mVerboseLevel >= VERBOSE_ONLY_RESULTS) {
std::cout << std::endl << "Final ";
tree.printTreeAnnotated(std::cout, NULL, 0, true);
tree.printTreeAnnotated(std::cout, NULL, 0, true, false);
std::cout << std::endl;
}
}
......@@ -873,6 +875,7 @@ int main(int aRgc, char **aRgv) {
true, &mVar);
tree.printTreeAnnotatedWithEstLens(std::cout, NULL, 0,
true, &mVar, false);
std::cout << std::endl;
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment