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.
| This article describes this feature for the latest version of TreeGraph 2. For older versions the following articles are available: Open files (until 2.0.34) |
Contents |
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 (http://bioinfweb.info/xmlns/xtg) 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 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.
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.
TreeGraph 2 is also able to read Nexus files which contain special node annotations generated by BEAST. They are loaded into hidden node data columns and could e.g. be visualized as text labels or used with the Calculating node/branch data function.
phyloXML is an XML language for the analysis, exchange, and storage of phylogenetic trees (or networks) and associated data. Although it is not as commonly used as the Nexus format (and not supported by all applications) it allows to store much more information about the tree nodes.
If a Newick, Nexus or phyloXML file is imported the branch length scale and the small interval of the scale bar are calculated automatically under the following conditions.
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.
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:
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.
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:
(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.
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).
In contrast to the XTG format phyloXML predefines several node/branch data field for special usage (e.g. taxonomic information, information about a molecular sequence associated with a node). When loading a phyloXML file TreeGraph moves the values from that data structure to its own (consisting of node names, labels and hidden node/branch data).
phyloXML documents can also contain several trees. If so you will be asked which tree to import just as you are when importing Newick or Nexus files (see above).
The following table describes how the data stored in a clade element of a phyloXML document is translated into the TreeGraph 2 data structure. (It is assumed that you are familiar with the phyloXML format. A formal definition of this format can be found here.)
phyloXML element under clade: |
TreeGraph 2 data structure: |
|---|---|
name |
Node name and hidden node data with the ID phyloXML.name |
branch_length |
Branch length |
confidence |
Text label (The type attribute defines the label ID. Since there are only numeric confidence values allowed in phyloXML, non numeric values are not imported. Note that although theoretically allows in phyloXML you should not use the same value for type more than one time on the same node, because TreeGraph 2 considers the value as a unique ID.) |
width* |
Branch width and hidden branch data with the ID phyloXML.branch_width (You can use the hidden branch data field with the Set distance values by node/branch data function if you want to rescale the branch widths or additionally apply them as node line widths.) |
color* |
Branch color and Node line color |
node_id |
This element is not imported. |
taxonomy.id |
This element is not imported. |
taxonomy.code |
Hidden node data with the ID phyloXML.taxonomy.code |
taxonomy.scientific_name |
Hidden node data with the ID phyloXML.taxonomy.scientific_name and node name if the name element was not specified |
taxonomy.authority |
Hidden node data with the ID phyloXML.taxonomy.authority |
taxonomy.common_name |
Hidden node data with the ID phyloXML.taxonomy.common_name and node name if neither the name nor the taxonomy.scientific_name elements were specified |
taxonomy.synonym |
Hidden node data with the ID phyloXML.taxonomy.synonym |
taxonomy.rank |
Hidden node data with the ID phyloXML.taxonomy.rank |
taxonomy.uri |
This element is not imported. |
sequence.type (attribute) |
Hidden node data with the ID phyloXML.sequence.type |
sequence.id_source (attribute) |
This element is not imported. |
sequence.id_ref (attribute) |
This element is not imported. |
sequence.symbol |
Hidden node data with the ID phyloXML.sequence.symbol |
sequence.accession |
Hidden node data with the ID phyloXML.sequence.accession |
sequence.name |
Hidden node data with the ID phyloXML.sequence.name and node name if neither the name nor the taxonomy.scientific_name nor the taxonomy.common_name elements were specified |
sequence.location |
Hidden node data with the ID phyloXML.sequence.location |
sequence.mol_seq |
This element is not imported. |
sequence.uri |
This element is not imported. |
sequence.annotation |
This element is not imported. |
sequence.domain_architecture |
This element is not imported. |
events |
This element is not imported. |
binary_characters |
This element is not imported. |
distribution.desc |
Hidden node data with the ID phyloXML.distribution.desc |
distribution.point |
This element is not imported. |
distribution.polygon |
This element is not imported. |
date.desc |
Hidden node data with the ID phyloXML.date.desc |
date.value |
Hidden node data with the ID phyloXML.date.value |
date.minimum |
Hidden node data with the ID phyloXML.date.minimum |
date.maximum |
Hidden node data with the ID phyloXML.date.maximum |
reference |
This element is not imported. |
property |
This element is not imported. |
* Note that the values for width and color are applied to all subelements unless they define own values for these fields.
After having imported a phyloXML document you can of course move, copy or delete the imported node/branch data columns (e.g. by making a hidden node data column a text label column) using the Copying node/branch data or Calculating_node/branch_data functions amongst others.