Skip to content
Steve Bond edited this page Feb 27, 2017 · 3 revisions

--ladderize, -ld

Implemented in version 1.3

Description

Reorder the branches of the tree based on the number of child nodes for every given subtree. Note that this does not change the actual structure of the tree, only the way it is drawn.

Argument

Reverse order ( str )

Optional. Passing in the word 'rev' will reverse the sort into descending order.

  • ascending (default) = subtrees with a smaller number of child nodes will be listed first
  • descending = subtrees with a larger number of child nodes will be listed first

Examples

Input file: test.tree

((A,(B,(C,(D,E)))),(F,(G,H)));
           /------------------------------------------- A
/----------+
|          |          /-------------------------------- B
|          \----------+
|                     |          /--------------------- C
|                     \----------+
+                                |          /---------- D
|                                \----------+
|                                           \---------- E
|
|                                /--------------------- F
\--------------------------------+
                                 |          /---------- G
                                 \----------+
                                            \---------- H

Usage example 1

$: pb test.tree -ld

Output

((F:1.0,(G:1.0,H:1.0):1.0):1.0,(A:1.0,(B:1.0,(C:1.0,(D:1.0,E:1.0):1.0):1.0):1.0):1.0):1.0;

                                 /--------------------- F
/--------------------------------+
|                                |          /---------- G
|                                \----------+
+                                           \---------- H
|
|          /------------------------------------------- A
\----------+
           |          /-------------------------------- B
           \----------+
                      |          /--------------------- C
                      \----------+
                                 |          /---------- D
                                 \----------+
                                            \---------- E

Usage example 2

$: pb test.tree -ld rev

Output

(((((D:1.0,E:1.0):1.0,C:1.0):1.0,B:1.0):1.0,A:1.0):1.0,((G:1.0,H:1.0):1.0,F:1.0):1.0):1.0;
                                            /---------- D
                                 /----------+
                      /----------+          \---------- E
                      |          |
           /----------+          \--------------------- C
           |          |
/----------+          \-------------------------------- B
|          |
|          \------------------------------------------- A
+
|                                           /---------- G
|                                /----------+
\--------------------------------+          \---------- H
                                 |
                                 \--------------------- F

Main Toolkit Pages





Further Reading

Clone this wiki locally