Help - Importing ancestral state probabilities from BayesTraits

From TreeGraph help

Note that BayesTraits version 3 uses a different syntax then earlier versions. TreeGraph has not yet been adjusted to this changes and therefore the feature described here only works with BayesTraits version 2 or earlier.

TreeGraph 2 is able to import probabilities for ancestral character states from a format specific for the software BayesTraits and to visualize these e.g. using pie chart labels attached to internal nodes.

You can access this feature by selecting "Import BayesTraits data..." from the file menu.

Note that this feature was not available before TreeGraph 2.5.0.

How is the BayesTraits data imported?

If an analysis was performed using BayesTraits to reconstruct the probability of certain character states at ancestral nodes or MRCAs these probabilities will be imported directly. If an MCMC analysis was performed a mean value of all probabilities will be calculated first. For each character/state combination according data can be imported into one new or existing node/branch data column (e.g. Text labels or hidden node/branch data).

Identifying according table rows and tree nodes

The leaf names specified to generate BayesTraits data are used to identify the nodes of the tree onto which all other according character state data from the output table should be imported.

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. Here you should select the node/branch data column of the tree which contains the same values as the leaf names used in BayesTraits (Note that the question, if two values are equal depends on the options you chose in the key column panel).

The dialogs

This function uses two dialogues which are displayed one after the other. The first allows you to choose the text file that contains the output of BayesTraits and the second one lets you select into which node/branch data column the character state probabilities contained in the output file shall be imported or if they should not be imported at all for certain characters. You can also choose here if pie chart labels displaying the state probabilities should be created for certain characters.

The first dialog of this feature expects the location of the BayesTraits log file and the node/branch data column containing the same terminals as they are used in the node or MRCA definitions of the log file.

The file dialog

This dialog is displayed first and is used to select the text file that contains the BayesTraits data 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 BayesTraits output file (usually named <originalFileName>.log.txt by BayesTraits) to be imported here.

Leaf names

  • 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 leaf names used to describe nodes or MRCAs in BayesTraits, to specify the nodes onto which the imported probability data from the table will be attached.
  • Ignore leading and trailing white spaces: Check this option, if you want the name "NodeA" to be considered a identical to " NodeA" or "NodeA ".
  • Distinguish between space (" ") and underscore ("_"): Check this option, if you want the name Node A to be considered a identical to Node_A.
  • Case sensitive: Check this option, if you want the name 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 name 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 second dialog of this feature allows to assign the different character state probabilities imported from BayesTraits to (new) node/branch data columns of TreeGraph.

The column dialog

Import character data

The dialog will contain a section for each reconstructed character that was found in the imported BayesTraits file. The checkbox on the left allows for each character (and all its states) whether to import it or not.

Additionally there will be one combo box for each of the character's states that lets you select the node/branch data column to which 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 to the right of the according combo box (a combination of character and state e.g. “0.1” for state “1” of character “0” will be suggested here, according to the names used in the BayesTraits output file).

There will be another check box for each character that lets you select whether you want to automatically create a Pie chart label from the imported ancestral state probabilities. You can also create pie chart labels later on after you imported the data.

Import internal node names

You can select into which node/branch data column you want to import the internal node names specified in BayesTraits (per default “Node names” will be selected here). If you do not wish to import these internal node names, choose “Do not import internal node names” in the drop down menu 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 to the right of the according combo box.

See also