Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Bio-Phylo CPAN distribution.

Report information
The Basics
Id: 35511
Status: resolved
Priority: 0/
Queue: Bio-Phylo

People
Owner: Nobody in particular
Requestors: jon [...] epcc.ed.ac.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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.
Dear Jon, thank you for bringing this to my attention - sorry about the belated reply. I have fixed your bug, and added a test file (called t/regress_35511.t) that will make sure it doesn't pop up again. What the test does is: * I parse a tree * I have an array with the names of all the tips * I prune these iteratively (as you describe you did) * I check that no exception is thrown for every pruning * I then count the number of remaining nodes, which should be 1 (the root) I think this resolves the issue, so I'm closing this ticket. Best wishes, Rutger Vos