Skip to content
This repository was archived by the owner on Jun 28, 2023. It is now read-only.

Three Column Color Map

Ryan Moore edited this page Sep 30, 2016 · 4 revisions

Table of Contents

Overview

See here.

Three Column Color Maps

The three column color map is used when you want to color labels and branches separately.

The three column color map has the following columns: name, label color, and branch color.

The following examples will all use the following Newick file.

(s1,(s2,(s3,(s4,(s5,(s6,(s7,s8)))))));

You can download the file here.

Command line coloring options with three colomn color maps

As in the two column color maps, we can specify whether to color labels, branches, or both at the command line. These options have a higher precedence than the color map itself. This means that the command line coloring options will override anything that is in the color map file. For example, if s1 is specified to have its label colored blue, and its branch colored red, but only the --color-branches option is passid to Iroki, any color specifications for labels in the color map will be ignored. The examples that follow will help illustrate this behavior.

A simple example

#Name Label Color Branch Color
s1 red green
s2 blue red

In this example, the label of s1 will be red while the branch will be green. Similarly, the label for s2 will be blue and the branch will be red.

Color labels and branches

Command line options: --color-branches --color-taxa-names.

A simple example tree

Color labels only

Command line options: --color-taxa-names.

A simple example -- labels only

Color branches only

Command line options: --color-branches.

A simple example -- branch only

The last example was a simple one, but the color map is actually pretty flexible in the different ways that you can specify colors. Let's take a look.

Without Tags

Iroki will infer whether you want the label or the branch to be colored based on the column.

#Name Label Color Branch Color
s1 blue red
s2 red blue
s3 blue
s4 red
s5 red
s6 blue

Color labels and branches

Command line options: --color-branches --color-taxa-names.

Tree without tags

Color labels only

Command line options: --color-taxa-names.

Tree without tags -- labels only

Color branches only

Command line options: --color-branches.

Tree without tags -- branches only

With Tags

Sometimes it is better to be explicit about what you are doing. Therefore you can use tags you can use tags to clarify things.

Regardless of the column that a color specification is in, if it has a tag, Iroki will use the tag to infer whether to color the label or the branch.

The following are all valid tags:

  • label:red
  • label:#ff0000
  • branch:red
  • branch:#ff0000

Here is an example of using tags.

#Name Label Color Branch Color
s1 label:blue branch:red
s2 label:red branch:blue
s3 branch:blue label:red
s4 branch:red label:blue
s5 label:blue
s6 label:red
s7 branch:red
s8 branch:blue

Color labels and branches

Command line options: --color-branches --color-taxa-names.

Tree with tags

Color labels only

Command line options: --color-taxa-names.

Tree with tags -- labels only

Color branches only

Command line options: --color-branches.

Tree with tags -- labels only

Some with tags, some without tags

You can mix specifying colors with tags and without tags, and Iroki will know what to do.

#Name Label Color Branch Color
s1 label:blue red
s2 label:red blue
s3 blue branch:red
s4 red branch:blue

Color labels and branches

Command line options: --color-branches --color-taxa-names.

Tree -- some with tags, some without

Color labels only

Command line options: --color-taxa-names.

Tree -- some with tags, some without -- labels only

Color branches only

Command line options: --color-branches.

Tree -- some with tags, some without -- labels only

Valid but redundant

This color map is valid, but each row has redundant color specification.

#Name Label Color Branch Color
s1 blue label:blue
s2 branch:blue blue
s3 label:blue label:blue
s4 branch:blue branch:blue

Invalid color map

This color map has rows which are all invalid because of ambiuguous color specification.

#Name Label Color Branch Color
s1 blue label:red
s2 label:blue label:red
s3 branch:blue red
s4 branch:blue branch:red
s5 label:blue
s6 branch:blue

Here are the reasons why each row is invalid...

  • s1 and s2 specify both blue and red for label color
  • s3 and s4 specify both blue and red for branch color
  • s5 specifies both blue and black for label color
  • s6 specifies both blue and black for branch color

Iroki will raise an error if your color map has any of the above ambiguities.

Clone this wiki locally