Subject: | Error in prune_tips |
Date: | Tue, 29 Apr 2008 13:33:38 +0100 |
To: | <bug-Bio-Phylo [...] rt.cpan.org> |
From: | "Jon Hill" <jon [...] epcc.ed.ac.uk> |
Hi,
I get an error in Tree.pm:
Can't locate object method "visit_post_order" via package
"Bio::Phylo::Forest::Tree" at C:/Perl/site/lib/Bio/Phylo/ Forest/Tree.pm
line 1654, <fTREES> line 1.
I've called prune_tips like:
push(@pruned,$name);
$tempTree->prune_tips(\@pruned);
Where @pruned is an array of names to prune (I do it one-by-one, so the
array only contains a single taxon).
I've fixed this on my installation by switching visit_post_order to
visit_level_order. See below.
sub prune_tips {
...
$self->visit_post_order(
sub {
my $node = shift;
if ( $node->is_terminal ) {
$self->delete($node) if not $keep{
$node->get_name };
}
...
}
sub prune_tips {
...
$self->visit_level_order(
sub {
my $node = shift;
if ( $node->is_terminal ) {
$self->delete($node) if not $keep{
$node->get_name };
}
...
}
Perl details:
C:\Documents and Settings\jhill5\My
Documents\EPCC\Projects\Supertrees\supertree_construction_kit>perl -v
This is perl, v5.10.0 built for MSWin32-x86-multi-thread (with 3 registered
patches, see perl -V for more detail)
Copyright 1987-2007, Larry Wall
Binary build 1002 [283697] provided by ActiveState
http://www.ActiveState.com Built Jan 10 2008 11:00:53
Using Bio-Phylo-0.17_RC6
Cheers,
Jon
---------------------------
Jon Hill
Applications Consultant,
EPCC,
University of Edinburgh,
Kings Buildings,
West Mains Road,
Edinburgh, EH3 3JZ
Tel: 0131 650 6494
Mob: 07748254812
http://www.geologyrocks.co.uk/
http://www.epcc.ed.ac.uk/~jon/
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.