[Bioperl-l] Unwise elimination of nodesinB:T:Node::remove_Descendent?
Mark A. Jensen
maj at fortinbras.us
Fri Feb 6 12:45:56 UTC 2009
Ok, Heikki-
Thanks; I'll go ahead with the commit to Node.pm. I agree too with
the idea of convenience methods that DWIM for users--your suggestion
in particular is a natural.
MAJ
----- Original Message -----
From: "Heikki Lehvaslaiho" <heikki.lehvaslaiho at gmail.com>
To: "Mark A. Jensen" <maj at fortinbras.us>
Cc: <bioperl-l at lists.open-bio.org>
Sent: Friday, February 06, 2009 1:37 AM
Subject: Re: [Bioperl-l] Unwise elimination of
nodesinB:T:Node::remove_Descendent?
> 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/
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
>
More information about the Bioperl-l
mailing list