Help - Exporting trees as Newick/Nexus files

From TreeGraph help
Jump to: navigation, search

TreeGraph 2 allows you (besides saving in its own XTG format) to export your trees to the Newick- or Nexus-format.

ArticleOnLatestVersion.png This article describes this feature for the latest version of TreeGraph 2. For older versions the following articles are available:
Exporting trees as Newick/Nexus files (until 2.5.0)


Supported formats

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 further 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.

The dialog

The "Export to tree format"-dialog

You can access the "Export to tree format"-dialog by selecting "Export to tree format..." from the file menu or with the keyboard shortcut F11.

File name

You have to enter the file name and location of the tree file to be exported here. (The proper file extension will be added automatically.)

File type

Here you can choose either Newick or Nexus as the tree format for the file to be exported.

Node name format

Here you can choose if node names shall be enclosed by quotation marks if necessary (i.e. if they contain spaces) or if spaces shall be replaced by underscores. If the latter is chosen actual node names (as displayed within TreeGraph) should not contain underscores, because they cannot be distinguished from spaces in the output file anymore. (Names like A B and A_B would both be exported as A_B.)

Note that this feature was not available before version 2.6.0.

Nexus file components

This option panel is only visible if "Nexus" is chosen as the file type.

Here you can choose whether a taxa block and/or a translation table shall be included in the exported Nexus file.

Note that this feature was not available before version 2.6.0.

Source data

Here you can select the node/branch data column to be written to the exported newick-string for the internal node names, the leaf node names and the branch lengths. You could e.g. select the "Node names" column for the leaf node names in the newick string and one type of label for the internal node names to store support values there.

Note that you can use only node/branch data columns with numeric values for the branch lengths. If your document does not contain any this option is disabled. You can choose to have no branch lengths in your exported file even if numeric data would be available by deselecting the checkbox left of the the drop down list.

Known problems on Macintosh systems

Due an error in the java implementation on Macintosh systems a file name entered in the Save as text field will not be approved when OK is clicked, if the file type has been changed before. You can work around this error if you first make all necessary setting in the dialog than go back to Save as text field and press Enter while this text field has the focus. This way the file name should be approved and the dialog is closed.

See also

Additional resources