Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
phylo
fastcodeml
Commits
e146c29f
Commit
e146c29f
authored
Mar 11, 2016
by
omid
Browse files
Fully correct final tree report
parent
888258e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Newick.cpp
View file @
e146c29f
...
...
@@ -265,16 +265,18 @@ int Newick::printTreeAnnotated(std::ostream &aOut, TreeNode *aNode, int aBranch,
// Special case for the root
if
(
!
aNode
)
{
if
(
wLeaves
)
if
(
bNumber
){
if
(
wLeaves
)
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
;
}
aOut
<<
'('
;
for
(
idx
=
0
;
(
m
=
mTreeRoot
.
getChild
(
idx
))
!=
NULL
;
++
idx
)
{
if
(
idx
>
0
)
aOut
<<
','
;
branch_idx
=
printTreeAnnotated
(
aOut
,
m
,
branch_idx
,
wLeaves
);
branch_idx
=
printTreeAnnotated
(
aOut
,
m
,
branch_idx
,
wLeaves
,
bNumber
);
}
aOut
<<
')'
;
mTreeRoot
.
printNode
();
...
...
@@ -284,7 +286,7 @@ int Newick::printTreeAnnotated(std::ostream &aOut, TreeNode *aNode, int aBranch,
if
(
wLeaves
)
branch_idx
=
aBranch
+
1
;
aNode
->
printNode
();
if
(
wLeaves
and
bNumber
)
if
(
wLeaves
&&
bNumber
)
aOut
<<
'*'
<<
aBranch
;
}
else
{
branch_idx
=
aBranch
+
1
;
...
...
@@ -292,7 +294,7 @@ int Newick::printTreeAnnotated(std::ostream &aOut, TreeNode *aNode, int aBranch,
for
(
idx
=
0
;
(
m
=
aNode
->
getChild
(
idx
))
!=
NULL
;
++
idx
)
{
if
(
idx
>
0
)
aOut
<<
','
;
branch_idx
=
printTreeAnnotated
(
aOut
,
m
,
branch_idx
,
wLeaves
);
branch_idx
=
printTreeAnnotated
(
aOut
,
m
,
branch_idx
,
wLeaves
,
bNumber
);
}
aOut
<<
')'
;
aNode
->
printNode
();
...
...
@@ -311,17 +313,19 @@ int Newick::printTreeAnnotatedWithEstLens(std::ostream &aOut, TreeNode *aNode,
// Special case for the root
if
(
!
aNode
)
{
if
(
wLeaves
)
if
(
bNumber
){
if
(
wLeaves
)
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
;
}
aOut
<<
'('
;
for
(
idx
=
0
;
(
m
=
mTreeRoot
.
getChild
(
idx
))
!=
NULL
;
++
idx
)
{
if
(
idx
>
0
)
aOut
<<
','
;
branch_idx
=
printTreeAnnotatedWithEstLens
(
aOut
,
m
,
branch_idx
,
wLeaves
,
mVar
);
printTreeAnnotatedWithEstLens
(
aOut
,
m
,
branch_idx
,
wLeaves
,
mVar
,
bNumber
);
}
aOut
<<
')'
;
mTreeRoot
.
printNodeWoutLen
();
...
...
@@ -333,7 +337,7 @@ int Newick::printTreeAnnotatedWithEstLens(std::ostream &aOut, TreeNode *aNode,
branch_idx
=
aBranch
+
1
;
aNode
->
printNodeWoutLen
();
std
::
cout
<<
std
::
setprecision
(
6
)
<<
":"
<<
(
*
mVar
)[
aBranch
];
if
(
wLeaves
and
bNumber
)
if
(
wLeaves
&&
bNumber
)
aOut
<<
'*'
<<
aBranch
;
}
else
{
branch_idx
=
aBranch
+
1
;
...
...
@@ -342,7 +346,7 @@ int Newick::printTreeAnnotatedWithEstLens(std::ostream &aOut, TreeNode *aNode,
if
(
idx
>
0
)
aOut
<<
','
;
branch_idx
=
printTreeAnnotatedWithEstLens
(
aOut
,
m
,
branch_idx
,
wLeaves
,
mVar
);
printTreeAnnotatedWithEstLens
(
aOut
,
m
,
branch_idx
,
wLeaves
,
mVar
,
bNumber
);
}
aOut
<<
')'
;
aNode
->
printNodeWoutLen
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment