Collapse each internal node of a tree in turn and print out tree

8 views
Skip to first unread message

Max Telford

unread,
Nov 12, 2018, 12:06:23 PM11/12/18
to bio-phylo
Hello

I can collapse an internal node but would essentially like to uncollapse it and then move on to the next one.

What I want is a series of tree files each of which has one different node collapsed.

Thank you for your help

Max


Rutger Vos

unread,
Nov 13, 2018, 6:59:58 AM11/13/18
to bio-...@googlegroups.com
The easiest way to do that would probably be to iterate over the nodes in the tree, and for each of those first clone the tree, then collapse on the clone, and write that to a file.

There is no 'uncollapse' method, because once you do the collapsing, the information about how the polytomy you've created was resolved, is lost, as well as the internal branch length you've removed.

--
You received this message because you are subscribed to the Google Groups "bio-phylo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bio-phylo+...@googlegroups.com.
To post to this group, send email to bio-...@googlegroups.com.
Visit this group at https://groups.google.com/group/bio-phylo.
For more options, visit https://groups.google.com/d/optout.

Telford, Max

unread,
Nov 13, 2018, 9:12:42 AM11/13/18
to bio-...@googlegroups.com
Thanks Rutger

I have tried cloning but not sure how to tie the node I am iterating on to the new (cloned) tree. The node object is a node of the initial tree.

I am sorry I am a very amateur coder.

Thanks again

Max

Max Telford
Professor of Zoology
Department of Genetics, Evolution and Environment,
University College London,
Darwin Building,
Gower Street,
London WC1E 6BT, UK.
Tel: +44 (0)20 7679 2554 (Internal: 32554)
Fax: +44 (0)20 7679 7096 
http://www.ucl.ac.uk/biology/academic-staff/telford/telford.html
____________________________________________________________________
Open access journal EvoDevo:  http://www.evodevojournal.com/
____________________________________________________________________


Rutger Vos

unread,
Nov 13, 2018, 7:41:46 PM11/13/18
to bio-...@googlegroups.com
Would it be possible to generate names for the internal nodes a priori? Names should be copied over during the clone, so you could retrieve the equivalent one with 
$tree->get_by_name($name)
Reply all
Reply to author
Forward
0 new messages