Skip to content

The process

Giorgio Bianchini edited this page Oct 11, 2021 · 2 revisions

Creating a plot in TreeViewer consists in defining a pipeline that describes the "process" that goes from a tree file on the user disk to the final tree plot.

This process consists of the following steps:

  1. Reading the tree file
  2. Transforming the tree(s) read from the file into a single tree that will be plotted
  3. Plotting the tree

Reading the tree file

In this step, the user selects a tree file in a supported format (e.g. Newick, NEXUS, Binary format, etc.); the program reads the tree (or trees) contained in the file and converts them into a useful representation in the computer's memory (RAM).

This step consists of two sub-steps:

  • First, the program determines the format of the tree file and recruits the most appropriate module to read it.
  • Then, the program actually reads and parses the trees in the file.

The first step is performed using a "File type" module (see Modules), while the second step uses a "Load file" module.

After this step has been completed (and regardless of which modules have been used), the program has access to a collection of trees that were read in from the file.

Transforming the tree(s)

TreeViewer only plots one tree at a time (at least, currently). This means that the collection of trees that has been read from the file needs to be "transformed" into a single tree. If the file contained just one tree, this trivially means selecting that tree from the collection; if instead the tree file contained many different trees, one could e.g. pick just one of those trees, or compute a consensus. This action is performed by a "Transformer" module.

The tree can then be further edited to make it more suitable for plotting; e.g. the branch lengths can be transformed to make the tree look like a cladogram, the root of the tree can be moved, or if an outgroup was used for rooting, this can be removed from the tree. These actions are performed by the various "Further transformation" modules.

After this step, a single tree has been defined and is ready to be plotted.

Plotting the tree

The first step in plotting the tree involves determining where on the plot surface each node of the tree should be placed. This is performed by the "Coordinates" modules.

Actually plotting the tree is demanded to the "Plot action" modules: each module draws a single element of the plot (e.g. the branches of the tree, or the labels on the tips). The same module can also be used multiple times to plot different things.

In the end, a plot is produced. Users can then export this plot in a general-purpose graphics format (e.g. SVG or PDF), or save the tree file (possibly including all the modules that have been enabled).

Clone this wiki locally