Two more issues

12 views
Skip to first unread message

Yan Wong

unread,
Jun 26, 2014, 12:19:51 PM6/26/14
to bio-...@googlegroups.com
Hopefully this will be the last time I ask(!).

1) Is there a way to call $tree->resolve() so that the newly created nodes are unnamed? The default seems to be to give them names like r1, r2, r3, etc.
2) $tree->remove_unbranched_internals() doesn't seem to remove the base node if it is unbranched, so ((A,B)C)D; is not simplified to (A,B)C; (or should that be (A,B)D;? )

Yan

Rutger Vos

unread,
Jun 27, 2014, 4:57:52 AM6/27/14
to bio-...@googlegroups.com
On Thu, Jun 26, 2014 at 6:19 PM, Yan Wong <hyan...@googlemail.com> wrote:
Hopefully this will be the last time I ask(!).

1) Is there a way to call $tree->resolve() so that the newly created nodes are unnamed? The default seems to be to give them names like r1, r2, r3, etc.

At this point these names are baked into the API of the version that is on CPAN. If this is really a problem to you there are two options:

1) you install the latest development version from http://github.com/rvosa/bio-phylo, where I added an optional argument to the resolve() method to indicate that you want unnamed nodes, like this: $tree->resolve(1)

2) you traverse the trees after resolving and set all node names that match /^r\d+$/ to undef
 
2) $tree->remove_unbranched_internals() doesn't seem to remove the base node if it is unbranched, so ((A,B)C)D; is not simplified to (A,B)C; (or should that be (A,B)D;? )

Ok, it looks like you need to install the development version from github, as you've uncovered a bug. The method was ignoring unbranched internals that descend from the root. I've now fixed this, the result being (A,B)D; in your case.

Best wishes,

Rutger

Yan Wong

unread,
Jun 27, 2014, 6:02:22 AM6/27/14
to bio-...@googlegroups.com
On Friday, 27 June 2014 09:57:52 UTC+1, Rutger Vos wrote:
... you install the latest development version from http://github.com/rvosa/bio-phylo

That's great, thanks for the swift reply. I'll do that.

Yan 
Reply all
Reply to author
Forward
0 new messages