Nexus file

The extensible NEXUS file format is widely used in bioinformatics. It stores information about taxa, morphological and molecular characters, distances, genetic codes, assumptions, sets, trees, etc. Several popular phylogenetic programs such as PAUP*, MrBayes, Mesquite, MacClade and SplitsTree use this format.

Syntax
A NEXUS file is made out of a fixed header  followed by multiple blocks. Each block starts with   and ends with  . The keywords are case-insensitive. Comments are enclosed inside square brackets [...].

There are a few pre-defined block names for common types of data. Examples include:


 * TAXA block : The TAXA block contains information about taxa.
 * DATA block : The DATA block contains the data matrix (e.g. sequence alignment).
 * TREES block : The TREES block contains phylogenetic trees described using the Newick format, e.g. :

The following example uses the three block types above:

Begin TAXA; Dimensions ntax=4; TaxLabels SpaceDog SpaceCat SpaceOrc SpaceElf; End; Begin data; Dimensions nchar=15; Format datatype=dna missing=? gap=- matchchar=.; Matrix ''[ When a position is a "matchchar", it means that it is the same as the first entry at the same position. ]''    SpaceDog SpaceCat SpaceOrc   [ same as atgttagctag-tgg ] SpaceElf ; End; BEGIN TREES; Tree tree1 = (((SpaceDog,SpaceCat),SpaceOrc,SpaceElf)); END;
 * 1) NEXUS