[Bioperl-l] Bio::TreeIO functions
jason.stajich at duke.edu
Tue Mar 7 10:01:46 EST 2006
On Mar 7, 2006, at 9:01 AM, Lucia Peixoto wrote:
> so bad that there's no collapse function yet, If I come up with
> usefull I'll add it
Shouldn't be hard to do - give it a shot - for the node you want to
collapse N, get N's ancestor A, add the children of N as children of
A instead, remove descendents of N, and then delete N.
I'll add a note to the wiki Project priority list so that it is
> On the other hand, the remove_nodes function, even if it removes
> the selected
> nodes and its children, alters the newick format and the end
> results can't be
> opened by any tree viewer, anyone has has a similar experience?
I've not had a similar experience, myself and others have used it to
prune trees successfully. Are you using bioperl 1.5.1 or the latest
code from CVS?
> I guess I should post this in bugzilla
please do and include a simple code sample that demonstrates the
> Quoting Jason Stajich <jason.stajich at duke.edu>:
>> On Mar 6, 2006, at 3:43 PM, Lucia Peixoto wrote:
>>> I am trying to colapse nodes bellow a certain bootstrap cutoff
>>> value, so I just
>>> work only with the most confident nodes on my trees.
>>> After getting the nodes bellow my cutoff (70, and with newick
>>> format the
>>> bootstrap value is actually the _creation_id), I though that if I
>>> just call
>> The bootstrap value is not the _creation_id, but it will be the
>>> id - you shouldn't be using methods that start with _
>> You can move it to the bootstrap with $node->bootstrap($id) if you
>> want but of course the newick format doesn't distinguish - you can
>> set the flavor of your newick format bootstrap values for reading and
>> writing when you init it with Bio::TreeIO. If you use a format like
>> NHX it will distinguish bootstrap from node Id although only ATV/
>> Forester will reliably read this format.
>> delete definitely removes a node completely to collapse nodes (and
>> those remodel the parent/child relationship) you want to use the
>> remove_Descendent and add_Descendent methods.
>> Please feel free to submit a 'collapse' function if you end up
>> writing something that works.
>>> $tree->remove_Node($node) I will just get rid of the nodes and
>>> update the
>>> ancestor relationships within the tree, however when I call it it
>>> deletes those nodes and all its children.
>>> Anyone has any idea how can I just delete certain nodes so that the
>>> children are
>>> preserved and the relationships are collpased to polytomies on the
>>> Lucia Peixoto
>>> Department of Biology,SAS
>>> University of Pennsylvania
>>> Bioperl-l mailing list
>>> Bioperl-l at lists.open-bio.org
>> Jason Stajich
>> Duke University
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
> Lucia Peixoto
> Department of Biology,SAS
> University of Pennsylvania
More information about the Bioperl-l