[Bioperl-l] Bio::TreeIO functions

Georgii A Bazykin gbazykin at Princeton.EDU
Tue Mar 7 10:10:58 EST 2006


I had similar experience... The attached script worked for me to
covert the bioperl-generated nexus tree into treeview-readable - check
if it helps you as a quick solution.

Yegor Bazykin


------------------------------
Tuesday, March 7, 2006, 9:01:46 AM, you wrote:

> Hi
> so bad that there's no collapse function yet, If I come up with something
> usefull I'll add it

> 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 guess I should post this in bugzilla

> Lucia

> Quoting Jason Stajich <jason.stajich at duke.edu>:

>>
>> On Mar 6, 2006, at 3:43 PM, Lucia Peixoto wrote:
>>
>> > Hi
>> > 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 $node-
>>  >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.
>>
>> -jason
>>
>> > $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
>> > actually
>> > 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
>> > confident
>> > nodes?
>> >
>> > thanks
>> >
>> >
>> > Lucia Peixoto
>> > Department of Biology,SAS
>> > University of Pennsylvania
>> > _______________________________________________
>> > Bioperl-l mailing list
>> > Bioperl-l at lists.open-bio.org
>> > http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>
>> --
>> Jason Stajich
>> Duke University
>> http://www.duke.edu/~jes12
>>
>>
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>


> Lucia Peixoto
> Department of Biology,SAS
> University of Pennsylvania
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nexus_bioperl2nexus_treeview.pl
Type: application/octet-stream
Size: 690 bytes
Desc: not available
Url : http://lists.open-bio.org/pipermail/bioperl-l/attachments/20060307/3685e310/attachment.obj 


More information about the Bioperl-l mailing list