[Bioperl-l] Unwise elimination of nodes inB:T:Node::remove_Descendent?

Heikki Lehvaslaiho heikki.lehvaslaiho at gmail.com
Fri Feb 6 06:37:02 UTC 2009


Mark,

You have not obviously committed any fixes so it is a bit difficult to
make sure how things work, but I would say that if your code works to
give the results at the end of your mail, do commit it.

The logic of things seems right: If you are keeping nodes, the code
will do the right thing. If you are manually removing nodes by naming
them, you better know what you are doing.

I would not worry about keeping backward compatibility when the code
has a clear error.

One solution that might highlight the issues in splicing to users
would be to add more verbosely named methods. E.g.

splice_subtrees(@leafnodeids) # input is leaf nodes, only. Removes
also "unnecessary" internal nodes

   -Heikki


2009/2/6 Mark A. Jensen <maj at fortinbras.us>:
> CORRECTION: please patch the previous post...
>
> ...
>>
>> code above. If you look at the tree, the nodes he really wants to keep are
>
> - the leaves [A,B,E], *plus* the internal nodes [x,y,z]; that is...
> + the leaves [A,B,E], *plus* the internal nodes [x,<root>,z]; that is...
>>
> - $tree->splice(-keep_id=>[A,B,E,x,'y',z])
> + $tree->splice(-keep_id=>[A,B,E,x,<root>,z])
>>
>> $tree->total_branch_length
>>
>> doesn't throw and returns 25, which is correct.
>
> sorry, it's late ... MAJ
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>



-- 
   -Heikki
Heikki Lehvaslaiho - heikki lehvaslaiho gmail com
http://kapkaupunki.blogspot.com/



More information about the Bioperl-l mailing list