Darwin Help

Back to Index

DrawTree

Function DrawTree - general front-end for drawing phylogenetic trees

Calling Sequence  DrawTree(tree,method,modif)
Parameters
NameTypeDescription

tree Treeinput tree to draw
method string(optional) method to display the tree
modif {string,symbol = anything}optional modifiers for the drawing
Return Type  NULL
Synopsis DrawTree draws a phylogenetic tree and produces a file containing postscripts commands. This is a single interface for all the methods and variants that we could imagine for drawing phylogenetic trees. The tree must contain length information in its nodes, as it is the common case for the functions which build the trees. The behaviour is classified according to the following phases:
 

Mode of tree display:


Vertical


Vertical horizontally equally spaced leaves, vertical height preserved


Unrooted planar representation, root is only identified by a small circle, branch distances are preserved. Also called Splat trees


Radial leaves are on equally spaced directions from the root, distances to the root preserved


RadialLines like Radial, with arcs indicating distances


Phylogram left to right horizontal branches, branch lengths preserved


Cladogram left to right horizontal branches, branches to leaves stretched to align right


Bisect like Radial, but parent is on bisector line


BisectLines like Bisect, with arcs indicating distances


ArcRadial a Cladogram drawn with polar coordinates

 

Reordering of leaves:


use the ordering in the Tree


OrderLeaves= permute the left-right subtrees to make the clusters as contiguous as possible


OrderLeaves=LeftHeavy permute the left-right subtrees to make the left subtrees the largest


OrderLeaves=Random randomly permute the left-right subtrees to (possibly) obtain better looking trees

 

Branch labelling:


Adaptive, 2-digit precision, branch labelling


LengthFormat= A string which is interpreted as a format of an sprintf call with the length of the branch. If set to the empty string, no branch labelling will happen.


LengthFormat= A procedure: (Length) -> string which takes the branch length as an argument and produces the string to be placed on the branch.


BranchDrawing= A procedure that will do all the branch drawing. (x1,y1, x2,y2, l) -> list( drawing commands). The branch spans from (x1,y1) to (x2,y2) and has a branch length l. Use ShowBootstrap to display boostrapping values on the branches.

 

Internal Nodes:


no labelling happens for internal nodes


InternalNodes= A procedure (Tree,x,y) -> list( drawing commands) which will be invoked every time that an internal node (identified by Tree), is drawn at position (x,y). ShowBootstrap would display the bootstrapping values for internal nodes if they are present in the fourth field of the Tree data structure.

 

Leaf display information:


circle with leaf[Label] written. If the Leaf contains additional arguments of the form: Shape = sss or Color = ccc, then the Leaf is displayed using the shape sss and color ccc. Alternatively, if the Label is the structure Color(colorcode,xxx), then xxx will be taken as the Label and will be colored with the given colorcode.


Legend leaf[Label] written (no circle)


LeafDrawing= A procedure (Leaf,x,y) -> list( drawing commands) to display the Leaf centered at (x,y).


Clusters= color and shape according to cluster


RadialLabels leaf labels radial

 

Cross referencing:


no cross referencing, all labelling is done with leaf[Label]


CrossReference all labelling is done with an alphanumeric character and leaf[Label] is cross referenced on the right

 

Title:


Title=anything Title to appear centered at the bottom

 

Size of Text:


TextSize= Set point-size for all text

 

Minimum branch length:


MinBranchLength=positive Force all branches to be of a minimum length. The labelling will be done with the original lengths, but the drawing will use this minimum value. This is a useful option when part of the tree is cramped together and difficult to see. The proportions will not be maintained, but the tree can be understood. It is recommended to display the edge lengths if this option is used.

 

list of drawing commands:


CTEXT(...) Centered text (as for DrawPlot)


LTEXT(...) Left aligned text (as for DrawPlot)


RTEXT(...) Right aligned text (as for DrawPlot)


LINE(...) Line (as for DrawPlot)


POLYGON(...) Closed polygon (as for DrawPlot)


CIRCLE(...) Circle (as for DrawPlot)

 

In all cases, provides the definition of the clusters, or groups of leaves. This can be done as:


list(anything) the numbering in the leaves is used as an index in this list, and the value is the cluster name. Clustering will be done on equal values.


procedure as above, but the value is obtained by running the procedure on the Leaf.

 

Drawing of lateral gene transfer (LGT) arrows: in the ArcRadial tree display, arrows can be drawn to depict LGTs. Each LGT must is characterized by its two endpoints, defined in a list placed in the 4th field of the relevant Tree() structure (or the 3rd field of a Leaf() structure), as follows: [ 'unique id', {'start','end'}, height, (optionally, an RGB color triplet)].

 

A list of drawing commands is composed of the objects (as defined in ?DrawPlot) LTEXT, CTEXT, RTEXT, LINE, POLYGON and CIRCLE.

See also BootstrapTree,   DrawPlot,   GapTree,   Leaf,   LeastSquaresTree,   PhylogeneticTree,   SignedSynteny,   Synteny,   SystemCommand,   Tree,   ViewPlot