Help - Old:Open files (until 2.0.34)

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

The option "Open..." in the file menu displays a dialog that can either be used to open TreeGraph 2 tree files (*.xtg) or to import other supported tree formats (e.g. Nexus). You can select any file in a supported format here to open it in the TreeGraph 2 editor.

Supported formats

TreeGraph 2 format

The TreeGraph 2 format with the file extension XTG (Extensible TreeGraph format) is the default tree format for TreeGraph 2 and allows to save an unlimited number of additional node/branch data columns and the TreeGraph 2 specific formats of the tree elements. Every XTG-file contains only one tree.

Because XTG is an XML format it can easily be used by developers of other applications if necessary. (A formal definition of XTG can be found here.)

Note that TreeGraph versions 2.0.41 and older did not declare the XML namespace ( in their generated XTG documents since it was not formally defined at that time. Later versions do so, but files with a declared namespace cannot be opened with older version. (They simply show an empty document after loading.) It is recommended to used the latest version of TreeGraph 2 but if there is a reason why you would have to open documents with version 2.0.41 or older, which were created with a later version, you would have to remove the namespace declarations manually from the <TreeGraphDocument> tag (e.g. with a text editor).

Newick format

Newick files are simply text files that consist of one or more tree descriptions in the Newick notation. In contrast to Nexus files they contain no further syntax elements or other information than the trees.

Nexus format

The Nexus format is widely used in phylogenetics and can contain trees in Newick notation and furthermore also information about taxa and phylogenetic datasets such as sequence alignments. Several common programs such as PAUP*, Mesquite and MacClade generate trees in this format. A Nexus file usually consists of different blocks which contain different types of information, whereas the trees-block is the only relevant one for TreeGraph 2. Just like Newick files, Nexus files can contain several trees.

Importing Nexus and Newick

If you want to import a Newick- or Nexus-file you have some more options than you have for opening an XTG-file because these file types support only two types of node/branch data: node names and branch lengths. The names of the terminal nodes are always imported as such into TreeGraph because they usually describe names of taxa. With respect to the internal node names and branch lengths stored in the Nexus- or Newick-file you can choose the branch/node data column in which you want these values to be stored.

Internal node names

Since the internal node names are often used to store support values, the open-dialog contains a combo box that allows selecting the type of node/branch data the internal node names of the Newick notation should be saved to. The following choices are possible:

  • Node names - The internal nodes of the TreeGraph document will contain the imported internal node names.
  • New text labels with the specified ID - For every internal node name of the Newick notation a text label will be created in the TreeGraph document which has the ID you specify in the input field right of the combo box.
  • New hidden branch data with the specified ID - The internal node names will be stored in hidden branch data fields in the TreeGraph document.
  • New hidden node data with the specified ID - The internal node names will be stored in hidden node data fields in the TreeGraph document.

Translate internal node names

Some Nexus files might contain a taxon table which specifies an ID for each taxon of the tree(s). The Newick string then only contains these IDs rather than the full taxon names. In these cases you can specify whether TreeGraph 2 should use this table only to translate the terminal node names or also the internal node names. Some programs use the internal node names to store support values which might erroneously be translated based on the taxon table if you check this option (e.g. a support value of 99 would be replaced by the 99th taxon in the list.)

Note that values in quotes (e.g. "99" instead of 99) will not be translated.

Branch lengths

Below the combo box for the internal node names you will find a second combo box which allows to select the way you want to import the branch lengths of the document to import. In this case you make this choice for all branch lengths including the lengths of branches that lead to terminal nodes. Here you have the following options:

  • Branch lengths - The branch length data of the imported file will also be stored as branch lengths in the TreeGraph document.
  • New text labels with the specified ID
  • New hidden branch data with the specified ID
  • New hidden node data with the specified ID

(Note that you can also move or copy the contents of different node/branch data columns later. (See Copying node/branch data for details.)

This feature was not available before TreeGraph 2.0.23.

The "Select tree"-dialog can displays previews of all trees contained in a Newick- or Nexus-file.

Files with several trees

If a Newick- or Nexus-file contains more than one tree you will be asked to select a single tree you want to import. The selection dialog will show you previews of all trees contained in the file you want to import (see example on the right).

See also

Additional resources