From 07632f4c055de8c39119a7529dfaee183dc8a606 Mon Sep 17 00:00:00 2001 From: Chris Fields Date: Fri, 9 Aug 2013 13:38:51 -0500 Subject: [PATCH] Merge branch 'master' of git://github.com/viklund/bioperl-live into topic/viklund-master --- Bio/Tree/TreeFunctionsI.pm | 2 +- t/Tree/Tree.t | 4 +++- t/data/bootstrap.tre | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Bio/Tree/TreeFunctionsI.pm b/Bio/Tree/TreeFunctionsI.pm index fb5c77dcb..defcf0356 100644 --- a/Bio/Tree/TreeFunctionsI.pm +++ b/Bio/Tree/TreeFunctionsI.pm @@ -1121,7 +1121,7 @@ sub findnode_by_id { sub move_id_to_bootstrap{ my ($tree) = shift; for my $node ( grep { ! $_->is_Leaf } $tree->get_nodes ) { - $node->bootstrap($node->id || ''); + $node->bootstrap(defined $node->id ? $node->id : ''); $node->id(''); } } diff --git a/t/Tree/Tree.t b/t/Tree/Tree.t index 4f8771db9..b8842fcd7 100644 --- a/t/Tree/Tree.t +++ b/t/Tree/Tree.t @@ -6,7 +6,7 @@ use strict; BEGIN { use lib '.'; use Bio::Root::Test; - test_begin(-tests => 64); + test_begin(-tests => 66); use_ok('Bio::TreeIO'); } @@ -258,11 +258,13 @@ $tree = $treeio->next_tree; my ($test_node) = $tree->find_node(-id => 'A'); is($test_node->ancestor->id, 90,'Testing bootstrap copy'); is($test_node->ancestor->ancestor->id, '25','Testing bootstrap copy'); +is($test_node->ancestor->ancestor->ancestor->id, '0','Testing bootstrap copy'); $tree->move_id_to_bootstrap; is($test_node->ancestor->id, '','Testing bootstrap copy'); is($test_node->ancestor->bootstrap, '90', 'Testing bootstrap copy'); is($test_node->ancestor->ancestor->id, '', 'Testing bootstrap copy'); is($test_node->ancestor->ancestor->bootstrap, '25', 'Testing bootstrap copy'); +is($test_node->ancestor->ancestor->ancestor->bootstrap, '0','Testing bootstrap copy'); # change TreeIO to parse $treeio = Bio::TreeIO->new(-format => 'newick', diff --git a/t/data/bootstrap.tre b/t/data/bootstrap.tre index 770ac1bbc..61d9659f7 100644 --- a/t/data/bootstrap.tre +++ b/t/data/bootstrap.tre @@ -1 +1 @@ -(((A:5,B:5)90:2,C:4)25:3,D:10); +((((A:5,B:5)90:2,C:4)25:3,D:10)0:4,E:11); -- 2.11.4.GIT