bioperl / bioperl-live-redmine

Legacy tickets migrated from the OBF Redmine issue tracker: http://redmine.open-bio.org
0 stars 0 forks source link

NodeMod issue #64

Open cjfields opened 8 years ago

cjfields commented 8 years ago

Author Name: FGarrett empty (FGarrett empty) Original Redmine Issue: 2946, https://redmine.open-bio.org/issues/2946 Original Date: 2009-11-06 Original Assignee: Greg Jordan


I was using BioPerl to parse some trees and perform some re-arrangments. At a given time I wanted to remove all descendents from a given node and so used the “remove_Descendant” function from “Bio::Tree::NodeMod.pm”. It works but when the parent node has no descendents its internal id changes. Since I was using the internal ids as node reference, the changing of a node id messed up my organization. Any particular reason for changing the node id? Is this a bug?

I’ve managed to fix it by comenting the last part of the “remove_descendent” function (see below). If it was a bug, does it has any side-effects?

my $a1 = $self->ancestor; if( $a1 ) { my $bl = $self->branch_length || 0; if (scalar @d == 1) { $d[0]>branch_length($bl + ($d[0]>branch_length || 0)); $a1->add_Descendent($d[0]); $a1->remove_Descendent($self); } }

cjfields commented 8 years ago

Original Redmine Comment Author Name: Chris Fields Original Date: 2010-08-02T17:44:31Z


FGarrett,

Do you mean Bio::Tree::Node? We don’t have a Bio::Tree::NodeMod in the distribution.

cjfields commented 8 years ago

Original Redmine Comment Author Name: FGarrett empty Original Date: 2010-08-10T09:29:24Z


Yes,

I meant Bio::Tree::Node

sorry for the mistake…

FGarrett

cjfields commented 8 years ago

Original Redmine Comment Author Name: Jason Stajich Original Date: 2011-03-27T18:18:59Z


I’m pretty sure this is because we’re reassigning things to deal with the removed node.

Greg - is there any way you can help track this?