How to rotate/flip/swap the two branches (subtrees) that come from one node.

359 views
Skip to first unread message

Àlbert Rafels

unread,
Dec 21, 2016, 4:18:59 AM12/21/16
to The ETE toolkit
As fas as I know, in a phylogenetic tree, you can swap the branches (all the subtree for each branch) from the same node without affecting the topology of it. Thus is just a matter of customizing the aspect of the tree, but I didn't find any option for that.

Can anyone help me?

Thanks

Jaime Huerta Cepas

unread,
Dec 21, 2016, 9:56:16 AM12/21/16
to eteto...@googlegroups.com
Hi Albert, 
you can use node.swap_children() to swap specific branches. 
To re-order all branches in a tree, you can also use tree.ladderize() and tree.sort_descendants()


cheers, 
-jaime

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

Àlbert Rafels

unread,
Jan 24, 2017, 7:08:04 AM1/24/17
to The ETE toolkit
Sincerely thanks jaime, 'tree.ladderize()' is exactly what I was looking for. 


El miércoles, 21 de diciembre de 2016, 15:56:16 (UTC+1), Jaime escribió:
Hi Albert, 
you can use node.swap_children() to swap specific branches. 
To re-order all branches in a tree, you can also use tree.ladderize() and tree.sort_descendants()


cheers, 
-jaime
On 21 December 2016 at 10:18, Àlbert Rafels <araf...@gmail.com> wrote:
As fas as I know, in a phylogenetic tree, you can swap the branches (all the subtree for each branch) from the same node without affecting the topology of it. Thus is just a matter of customizing the aspect of the tree, but I didn't find any option for that.

Can anyone help me?

Thanks

--
You received this message because you are subscribed to the Google Groups "The ETE toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to etetoolkit+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages