[Bioperl-l] Unwise elimination of nodes inB:T:Node::remove_Descendent?
heikki.lehvaslaiho at gmail.com
Fri Feb 6 01:37:02 EST 2009
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
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])
>> 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
Heikki Lehvaslaiho - heikki lehvaslaiho gmail com
More information about the Bioperl-l