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 { ...@@ -258,7 +258,7 @@ void Newick::printTreeUnformatted(std::ostream &aOut, TreeNode *aNode) const {
} }
int Newick::printTreeAnnotated(std::ostream &aOut, TreeNode *aNode, int aBranch, int Newick::printTreeAnnotated(std::ostream &aOut, TreeNode *aNode, int aBranch,
bool wLeaves) const { bool wLeaves, bool bNumber) const {
TreeNode *m; TreeNode *m;
unsigned int idx; unsigned int idx;
int branch_idx = aBranch; int branch_idx = aBranch;
...@@ -266,10 +266,10 @@ int Newick::printTreeAnnotated(std::ostream &aOut, TreeNode *aNode, int aBranch, ...@@ -266,10 +266,10 @@ int Newick::printTreeAnnotated(std::ostream &aOut, TreeNode *aNode, int aBranch,
// Special case for the root // Special case for the root
if (!aNode) { if (!aNode) {
if (wLeaves) 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 else
aOut << "Annotated Newick Tree (*N marks the internal branch N)" aOut << "Annotated Newick Tree (*N marks the internal branch N)"
<< std::endl; << std::endl << std::endl;
aOut << '('; aOut << '(';
for (idx = 0; (m = mTreeRoot.getChild(idx)) != NULL; ++idx) { for (idx = 0; (m = mTreeRoot.getChild(idx)) != NULL; ++idx) {
if (idx > 0) if (idx > 0)
...@@ -284,7 +284,7 @@ int Newick::printTreeAnnotated(std::ostream &aOut, TreeNode *aNode, int aBranch, ...@@ -284,7 +284,7 @@ int Newick::printTreeAnnotated(std::ostream &aOut, TreeNode *aNode, int aBranch,
if (wLeaves) if (wLeaves)
branch_idx = aBranch + 1; branch_idx = aBranch + 1;
aNode->printNode(); aNode->printNode();
if (wLeaves) if (wLeaves and bNumber)
aOut << '*' << aBranch; aOut << '*' << aBranch;
} else { } else {
branch_idx = aBranch + 1; branch_idx = aBranch + 1;
...@@ -296,7 +296,7 @@ int Newick::printTreeAnnotated(std::ostream &aOut, TreeNode *aNode, int aBranch, ...@@ -296,7 +296,7 @@ int Newick::printTreeAnnotated(std::ostream &aOut, TreeNode *aNode, int aBranch,
} }
aOut << ')'; aOut << ')';
aNode->printNode(); aNode->printNode();
aOut << '*' << aBranch; if (bNumber) aOut << '*' << aBranch;
} }
return branch_idx; return branch_idx;
......
...@@ -67,7 +67,7 @@ public: ...@@ -67,7 +67,7 @@ public:
/// ///
virtual int printTreeAnnotated(std::ostream &aOut, TreeNode *aNode = NULL, virtual int printTreeAnnotated(std::ostream &aOut, TreeNode *aNode = NULL,
int aInternalBranch = 0, 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 /// Print the phylogenetic tree completed with all the info loaded in the same
/// format as read in and annotated with the branch numbers. /// format as read in and annotated with the branch numbers.
......
...@@ -617,6 +617,7 @@ int main(int aRgc, char **aRgv) { ...@@ -617,6 +617,7 @@ int main(int aRgc, char **aRgv) {
if (cmd.mVerboseLevel >= VERBOSE_ONLY_RESULTS) { if (cmd.mVerboseLevel >= VERBOSE_ONLY_RESULTS) {
std::cout << std::endl << "Final "; std::cout << std::endl << "Final ";
tree.printTreeAnnotated(std::cout, NULL, 0, true); 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) { ...@@ -853,6 +854,7 @@ int main(int aRgc, char **aRgv) {
if (cmd.mVerboseLevel >= VERBOSE_ONLY_RESULTS) { if (cmd.mVerboseLevel >= VERBOSE_ONLY_RESULTS) {
std::cout << std::endl << "Final "; std::cout << std::endl << "Final ";
tree.printTreeAnnotated(std::cout, NULL, 0, true); tree.printTreeAnnotated(std::cout, NULL, 0, true);
tree.printTreeAnnotated(std::cout, NULL, 0, true, false);
std::cout << std::endl; std::cout << std::endl;
} }
} }
...@@ -873,6 +875,7 @@ int main(int aRgc, char **aRgv) { ...@@ -873,6 +875,7 @@ int main(int aRgc, char **aRgv) {
true, &mVar); true, &mVar);
tree.printTreeAnnotatedWithEstLens(std::cout, NULL, 0, tree.printTreeAnnotatedWithEstLens(std::cout, NULL, 0,
true, &mVar, false); 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