TEXT FORMAT

Nexus

Nexus file (phylogenetic trees)

NEXUS is a plain-text data format for phylogenetic, taxonomic, and comparative biological data, introduced in 1997 by David R. Maddison, David L. Swofford, and Wayne P. Maddison in a paper in Systematic Biology. It grew out of a shared file convention developed from 1987 onward for the programs MacClade and PAUP, and became the de facto interchange standard across systematics software including PAUP*, MrBayes, Mesquite, SplitsTree, and Genetic Data Analysis. Files carry the extensions .nex or .nxs and begin with the magic token #NEXUS.

The defining design principle is modularity. A NEXUS file is a sequence of named blocks, each delimited by BEGIN blockname; and END;, so that a program can read the blocks it understands and silently skip the rest. The specification defines a set of public blocks: TAXA (the operational taxonomic units and their canonical order), CHARACTERS and the convenience block DATA (character-by-taxon matrices for morphological or molecular data), UNALIGNED, DISTANCES (distance matrices), CODONS, SETS (named CHARSET/TAXSET groupings), ASSUMPTIONS (weights, step costs, exclusion status), and NOTES for metadata. Within CHARACTERS, the MATRIX command holds rows of taxa against columns of character states, with optional TRANSPOSE and INTERLEAVE arrangements. Taxa, characters, and trees each carry an implicit ordering and may be referenced by name or by number.

Trees are stored in the TREES block as nested-parenthesis descriptions in the closely related Newick notation, for example Tree tree1 = ((Alpha,Beta),Gamma,Delta);, optionally with a TRANSLATE table mapping integers to taxon names. Syntactically NEXUS is token-based and case-insensitive, uses square brackets for comments, and terminates commands with semicolons.

In the graph and format-conversion landscape NEXUS is fundamentally a tree/matrix container rather than a general graph language, but its trees map directly onto the same rooted-tree model as Newick, phyloXML, and NeXML, and tools such as Biopython and ete3 read and write it. Its main weaknesses are the flip side of its flexibility: there is no formal machine-checkable grammar, non-compliant extensions have accumulated across programs so that files written by one tool may not parse in another, and it cannot cleanly express reticulate structures such as networks or horizontal gene transfer, nor certain character ambiguities. The XML-based NeXML was designed as a validatable successor to address exactly these interoperability gaps while preserving the NEXUS data model.

Alternative Names: NEXUS

File Extensions: .nex.nexus.nxs v1.0
FeatureNexus file (phylogenetic trees)
Multiple Graphs per Document supported
Nodes supported
Undirected Edges supported
Directed Edges supported
Hyperedges not supported
Mixed-directionality Edges not supported
Parallel Edges not supported
Self-loops not supported
Edges on Edges not supported
Nested Graphs in Nodes not supported
Nested Graphs in Edges not supported
Nested Graphs in Graphs not supported
Node Labels supported
Edge Labels not supported
Attributes on Edges supported
Attributes on Graphs supported
Typed Edges not supported

Tools(Read & Write)

Write-only Tools

Frequently Asked Questions

What is a Nexus file (phylogenetic trees) file?

A Nexus file (phylogenetic trees) file stores a graph — its nodes, edges and attributes — in the Nexus file (phylogenetic trees) format (also: NEXUS). See the feature table above for what it supports.

How do I open a Nexus file (phylogenetic trees) file?

Open it in a graph tool that supports Nexus file (phylogenetic trees), or convert it to a format your tool reads. With GraphInOut you can convert Nexus file (phylogenetic trees) to GraphML, DOT, Connected JSON and more, right in your browser.

How do I convert a Nexus file (phylogenetic trees) file to another format?

Use the Convert from Nexus file (phylogenetic trees) link above: upload or paste your Nexus file (phylogenetic trees) file (input preset to Nexus file (phylogenetic trees)), choose a target format and download the result — free, no install.