A file in NEXUS format store the strings in the data block as follows:
#NEXUS Begin data; Dimensions ntax = 3 nchar = 94; Format datatype = nucleotide gap = - missing = ?; Matrix Taxon1 ATGGGAGCGGGGGCGTCTGTTTTGAGGGGAGAGAAGCTAGATACATGGGAAAAAAAAGTACATGATAAAACATCTGGTTTGGGCAAGATCGGAG Taxon2 AGCGGGAAAAAATTAGATTCATGGGAGAAAATTCGGTTAAGGCCAGGGGGAAACAAAAAATATNNNNNNNNNNNNNTTGGCCGCTNNN---GAG Taxon3 ACTGGGACAATTACAACCAGCTCTTCGGTTAAGGCCAGGGTCCAGACAGGAACAGAATTCGGTTAAGGCCAGGGCTTAGATCATTATAT----- ; End;
Note that NEXUS is the alignment format, i.e. all sequences must be the same length ('N' as unknown character or
"-" as gap also counts) and correspond the nchar
.
NEXUS file may contain additional blocks besides data
. Each block starts with BEGIN block_name;
and finishes with END;
For example, TREES block contains phylogenetic trees for the data using the Newick format, e.g. ((A,B),C);
#NEXUS Begin trees; Tree tree1= (fish,(frog,(snake, mouse))); End;
A formal detailed description of the NEXUS format can be found in Maddison et al. (1997).