ETE - Make tree ultrametric with internal node labels
1
0
Entering edit mode
8.3 years ago
moranr ▴ 290

Is there a way to create an ultrametric tree in ETE (preferably ete2) for a tree that contains some internal branch attribute labels. I can make one with no attributes set, however I cannot make one when my tree has the attribute faces added to internal nodes.

Any solved this problem before ?

Thanks., R

EDIT: More detail

My tree currently looks something like this :http://imgur.com/cn04ylK

I visualize the attributes by grabbing with AttrFace and using the node.add_face function in a custom Treestyle layout function.

python phylogenetics • 2.7k views
ADD COMMENT
0
Entering edit mode

Have you tried format=3, features=[your attributes] (which created a NHX extended newick)?

For example,

t.write(format=3, features=['vowel'])

'((D:0.723274[&&NHX:vowel=False],F:0.567784[&&NHX:vowel=False])E:0.067192[&&NHX:vowel=True],(B:0.279326[&&NHX:vowel=False],H:0.756049[&&NHX:vowel=False])B:0.807788[&&NHX:vowel=False]);'

The following page shows an example of adding attributes to internal nodes.

http://etetoolkit.org/docs/latest/tutorial/tutorial_trees.html#node-annotation

In the worse case, you can always code your attribute to the node names.

ADD REPLY
0
Entering edit mode

Ill add a little more detail to the question. I can add attributes. I just need to be able to add branch labels to both leaf nodes and internal nodes and output a tree with aligned taxa.

ADD REPLY
0
Entering edit mode
8.3 years ago
jhc ★ 3.0k

Not completely trivial - you would need to know the exact size of the graphical items associated to internal faces, and the compensate branches as needed.

Another option would be to use a custom layout where you add all tip names (or other leaf faces) in "aligned" position, and then turn TreeStyle.draw_guiding_lines=True. The effect should be like having all leave nodes aligned by compensating their branch lengths.

ADD COMMENT

Login before adding your answer.

Traffic: 2251 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6