[Bioperl-guts-l] [BioPerl - Bug #3164] (Resolved) TreeFunctionsI.pm syntax bug

redmine at redmine.open-bio.org redmine at redmine.open-bio.org
Sun Mar 27 13:30:52 EDT 2011

Issue #3164 has been updated by Jason Stajich.

Status changed from In Progress to Resolved
% Done changed from 0 to 90

Greg has checked in code, there is some merging left to do but it should be finished
Bug #3164: TreeFunctionsI.pm syntax bug

Author: Fayer Michael
Status: Resolved
Priority: Normal
Assignee: Greg Jordan
Category: Core Components
Target version: 1.6 branch

I found this bug when I try to use the method simplify_to_leaves_string() to reduce a big tree. It stop at line 655 when trying to modify a node with 6 desecent nodes into binary:
  "my $art = $top_node->new(-id => "artificial_".++$self->{_art_num});"
and said something close to: "$top_node is not a reference and has no new method".

This line is in method force_binary() of Bio::Tree::TreeFunctionsI. Then I traced down into the code in TreeFunctionsI.pm and found the problem is actually in line 653:
  "foreach my $top_node (@artificials || $node) {"

Array @artificials will become a scalar (length of the array) if it is not empty, so error occurred. Maybe the author used old syntax. So simply modifing this line into the following line fixed the problem:
  "foreach my $top_node (defined(@artificials) ? (@artificials) : $node) {"

The authod may want to fix the bug. I am using the "native" bioperl (version 1.6.1-1ubuntu1) installed by Synaptic in Ubuntu 10.04 (64-bit). This bug was also found in Windows.

By the way, I guessed the component "bioperl-pedigree" since I couldn't find Bio::Tree and have to guess.

You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here and login: http://redmine.open-bio.org

More information about the Bioperl-guts-l mailing list