How to plot a dendrogram with all its leaves starting in the same distance

72 views
Skip to first unread message

Alejandro Alvarez

unread,
Apr 30, 2012, 12:49:57 AM4/30/12
to The ETE toolkit
Greetings,

I am having problems to fixing the distance of the first leaves on the
tree. Generally, the package produces something like this:

/-asujm
/---|
| | /-dgoxb
| \---|
----| \-vwfdl
|
| /-fgrqo
\---|
\-yabte

but i need something like this

/------ asujm
/---|
| | /- dgoxb
| \---|
----| \- vwfdl
|
| /------ fgrqo
\---|
\------ yabte

Where all the leaves are in the same initial distance. Someone can
help me? I can see nothing about in the tutorial.

Thanks everyone.

Jaime Huerta Cepas

unread,
Apr 30, 2012, 3:35:05 AM4/30/12
to eteto...@googlegroups.com
Hola Alejandro,

Have you tried with "tree.convert_to_ultrametric()" function"?
http://packages.python.org/ete2/reference/reference_tree.html#ete2.TreeNode.convert_to_ultrametric

You can use two strategies: "balanced" (default. All branch lengths are modified as needed) or "fixed" (only terminal branch lengths are adjusted to end at the same point). Is this what you need?

Jaime

Alejandro Alvarez

unread,
Apr 30, 2012, 4:27:57 PM4/30/12
to The ETE toolkit
Hi,

Thanks, my problem has been solved, using the function that you
suggest.

Thanks, you are the master :-)

On Apr 30, 3:35 am, Jaime Huerta Cepas <jhue...@crg.es> wrote:
> Hola Alejandro,
>
> Have you tried with "tree.convert_to_ultrametric()" function"?http://packages.python.org/ete2/reference/reference_tree.html#ete2.Tr...
Reply all
Reply to author
Forward
0 new messages