Help - Old:Importing node/branch data (until 2.11.1)

From TreeGraph help
ArticleOnOlderVersion.png This article describes this feature for TreeGraph 2.11.1 or (not necessaryly all) earlier versions. See here for the article on the latest version and a list on other available article versions.


Besides importing node/branch data from tree files (see Adding support values) TreeGraph 2 also allows to import annotations from tables in text format as they can be generated by every spread sheet application. The only condition is that the first column of that table contains unique values that can also be found in one node/branch data column (e.g. Unique node names, node names, hidden node/branch data, ...) of the tree into which the table shall be imported.

In contrast to previous versions, TreeGraph 2.0.50 and later is able to identify the target nodes for the import by any node/branch data column and not just by the Unique node names. You can access this function by selecting "Import table as node/branch data as table..." from the file menu or with the keyboard shortcut Shift + F9.

How is the table imported?

Identifying according table rows and tree nodes

The first column of the imported table is called the key column because it contains values (keys) that identify the node of the tree onto which all other columns of that row shall be imported. All values in that column have to be unique, i.e. there must not be two rows containing the same value in the key column. (Note that the question, if two keys are equal depends on the options you chose in the key column panel. See below.)

When importing a table you are asked which node/branch data column in the tree shall be used to identify the nodes to attach the data to. (See dialog description below.) Here you should select the node/branch data column of the tree which contains the same values as the key column of your table. The entries in this node/branch data column do not have to be unique. If multiple tree nodes have the same value in that column the data from the according key column is attached to all of these nodes.

Replacing the contents of a node/branch data column

Since the extended version of this table import function was released (TreeGraph version 2.0.50) the apply name table function used to replace values of a node/branch data column (e.g. lab codes of sequences by real taxon names) was removed from the application because it is now included in this function. To perform such a replacement you need a table with two columns (the first one containing the old and the second one containing the new values for the node/branch data to be processed. Now you only have to select the same node/branch data column for the key column in table using the first dialog (see below and for the target node/branch data column in the second dialog. (The target nodes of the import will of course be identified before there values are changed to make this work.)

The dialogs

This function uses two dialogs which are displayed one after the other. The first allows you to choose the text file that contains the table to be imported and the second one lets you select into which node/branch data columns the annotations contained in the table shall be copied.

The "Import node/branch data"-dialog

The file dialog

This first dialog is displayed first and is used to select the text file that contains the table to be imported and specify further options in how to identify the target tree nodes. Click the Next > button to get to the next dialog.

File

Select the text file that contains the table to be imported here.

Table preferences

You give information on the structure of the text file you want to import here.

  • Values separated by: Here you can choose the column separator that has been used in the text file (usually tab or comma).
  • Number of lines to skip before heading or data: If your file contains additional text before the table starts, you can specify the number of initial lines that shall be ignored when reading the data here. (An optional line containing column headings (see below) would not be counted as an ignored line here.)
  • First line (after skipped lines) contains column headings: Check this option, if the first line of your table contains column headings and not data. (These headings are than suggested as node/branch data IDs, when you select the node/branch data columns of your tree to store the data in the next step.)

Key column

  • Column in tree to identify nodes: From this drop down menu you should select the node/branch data column which contains the same values as the first column (key column) of your table, to specify the nodes to which the data from the imported table rows will be attached.
  • Ignore leading and trailing white spaces: Check this option, if you want the key "NodeA" to be considered a identical to " NodeA" or "NodeA ".
  • Distinguish between space (" ") and underscore ("_"): Check this option, if you want the key Node A to be considered a identical to Node_A.
  • Case sensitive: Check this option, if you want the key Node A to be considered a identical to Node a or NODE A.
  • Parse numeric values if possible: Check this option, if you want the key 200 to be considered a identical to 200.0 (e.g., English decimal separator), 200,0 (e.g., German decimal separator) or 2E2 (2 · 102).
    • Both decimal separators are supported here. Thousand separators are not allowed, because it would not possible to distinguishing e.g. between "1,236" meaning 1236 in e.g. English and "1,236" meaning 1.236 in e.g. German. In case you have a data file containing thousand separators, use the according format function a spread sheet application (e.g. OpenOffice Calc) or the replace function of a text editor to remove them before opening the file with TreeGraph.
    • If any value can not be parsed as a number, it is still treated as a textual key.


The "Import node/branch data"-dialog


The column dialog

Depending on how many columns are contained in the text (additional to the key column) there will be a combo box for each column that lets you select the node/branch data column where you want to import the data. You can select existing or new columns here. If you select a new group of labels or a new hidden node/branch data column you also have to specify an ID in the text field right of the according combo box. (If your table contains a heading row and you checked the according option in the previous dialog the headings will be suggested as IDs here.)

See also