The extensible NEXUS file format is widely used in phylogenetics, evolutionary biology, and bioinformatics. It stores information about taxa, morphological character states, DNA and protein sequence alignments, distances, and phylogenetic trees. The NEXUS format also allows the storage of data that can facilitate analyses, such as sets of characters or taxa. Many popular phylogenetic programs, including PAUP*, MrBayes, Mesquite, MacClade, and SplitsTree, use this format. Nexus file names typically have the extension <code>.nxs</code> or <code>.nex</code> .
A NEXUS file is made out of a fixed header <code>#NEXUS</code> followed by multiple blocks. Each block starts with <code>BEGIN block_name;</code> and ends with <code>END;</code>. The keywords are case-insensitive. Comments are enclosed inside square brackets . Each of the pre-defined types of blocks may appear only once.
The following example NEXUS uses the TAXA, CHARACTERS, and TREES blocks:
#NEXUS Begin TAXA; Dimensions ntax=4; TaxLabels Alpha Beta Gamma Delta; End;
Begin CHARACTERS; 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. ] Alpha Beta Gamma [ same as atgttagctag-tgg ] Delta ; End;
Begin TREES; Tree tree1 = ((Alpha,Beta),Gamma,Delta); END;