Question: ETE - Make tree ultrametric with internal node labels
0
gravatar for moranr
2.9 years ago by
moranr250
Ireland
moranr250 wrote:

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.

phylogenetics python • 929 views
ADD COMMENTlink modified 2.9 years ago by jhc2.8k • written 2.9 years ago by moranr250

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 REPLYlink written 2.9 years ago by zwdzwd120

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 REPLYlink written 2.9 years ago by moranr250
0
gravatar for jhc
2.9 years ago by
jhc2.8k
Germany
jhc2.8k wrote:

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 COMMENTlink modified 2.9 years ago • written 2.9 years ago by jhc2.8k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2163 users visited in the last hour