Question: ETE - Make tree ultrametric with internal node labels
gravatar for moranr
2.9 years ago by
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 :

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'])


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

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
gravatar for jhc
2.9 years ago by
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.


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