Help - Old:Applying name tables

From TreeGraph help

This function has been integrated into the extended Importing node/branch data function since version 2.0.50. See this article on how to apply name tables in recent versions of TreeGraph 2.

TreeGraph 2 allows you to apply a name table to node/branch data column. A name table is a table with two columns. The first column contains all or some the values the node/branch data column currently has and second the new values is should have after the name table is applied. You could e.g. use this function to replace your lab codes by real taxon names if you have generated your tree with lab codes as terminal node names. (The tutorial "Taxon counts as branch widths" also demonstrates this feature.)

Note that some of the features described in this article are only available in TreeGraph 2.0.19 or later.

How are the values replaced?

The algorithm is going through all nodes of your tree and compares the value of selected node/branch data with the value of the first name table column (in the text file). The first line that matches the node value is selected and the node value is replaced by the value of the second column of that line.

Which values are considered as equal depends on the data type (string or decimal) the node value has. If the node currently contains a numeric value the algorithm searches for a line that contains any valid representation of that value in the first column (e.g. "100", "  100", "100  ", "100.0" or "1E2" for 100) no matter if you have selected to ignore leading and trailing white spaces or not. In contrast to that the matching of string node values depends an the selected options (see above).

The type of the node value after the processing of the name table is not necessarily the same as before. It depends on the new value specified in the name table (text file) and if you selected parse numeric values or to store them as strings (see above).

The dialog

The "Apply name table"-dialog

You can access the "Apply name table"-dialog by selecting "Apply name table..." from the file menu.

Name table file

Here you can select the name table to apply. A name table must be a text file that contains two columns of values which are separated by the specified character (see below). Each line has to be separated by a line break. Instead of a text editor you also use a spreadsheet program (e.g. OpenOffice.org Calc or Microsoft Excel) to create your table. You than have to select tab-separated text (*.txt) as the format (in the "Save as..."-dialog).

Values separated by

Here you can select the column delimiter contained in the text file with your table data. This will usually be tab (preselected). Otherwise you can select the radio button next to the text field and enter your column separator here (e.g. "," or ";"). Separators can only be single characters.

Target node data

You have to select a node/branch data column where the values should be replaced. All available columns are listed in the combo box at the bottom of the dialog.

Ignore leading and trailing white spaces

You can specify to ignore leading and trailing white spaces here. If you do so column values like " A" or "A " will be treated as "A". This is only of interest for the old values and the first column of your table which have to be compared to find the correct lines for each tree node. White spaces in the second column of your table (which will make up the new tree node values) will not be effected by this option ("A " stays "A ").

Case sensitive

Check this option if you want to the current node values and the line identifiers in the name table (values of the first column) to compared case sensitive. Otherwise e.g. "Abc" and "abc" will be considered as equal.

Parse numeric values

If you check this option all new values of the node/branch data column (imported from the second column of the name table) that are valid representations of numeric values (e.g. "98", "75.46" or "5.2E-3") will be stored as numeric values and displayed with the decimal format of the certain node (which you can change later using the Element formats-dialog). The format information in the table (e.g. if the value was "100" or "100.0") will be lost if you check this option.

See also