ArticleslgStudy

biology

Newick format

Newick format is a biology topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Newick format rather than just read about it. In short: In mathematics and phylogenetics, Newick tree format (or Newick notation or New Hampshire tree format) is a way of representing graph-theoretical trees with edge lengths using parentheses and commas. It was adopted by James Archie, William H.

Newick format — main illustration
Newick format — illustration

Key takeaways

  • Newick format belongs to biology; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Newick format to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Newick format from memory before moving on to harder problems.

Reference excerpt

In mathematics and phylogenetics, Newick tree format (or Newick notation or New Hampshire tree format) is a way of representing graph-theoretical trees with edge lengths using parentheses and commas. It was adopted by James Archie, William H. E. Day, Joseph Felsenstein, Wayne Maddison, Christopher Meacham, F. James Rohlf, and David Swofford, at two meetings in 1986, the second of which was at Newick's restaurant in Dover, New Hampshire, US. The adopted format is a generalization of the format developed by Meacham in 1984 for the first tree-drawing programs in Felsenstein's PHYLIP package.

Examples The following tree:

could be represented in Newick format in several ways

(,,(,)); no nodes are named (A,B,(C,D)); leaf nodes are named (A,B,(C,D)E)F; all nodes are named (:0.1,:0.2,(:0.3,:0.4):0.5); all but root node have a distance to parent (:0.1,:0.2,(:0.3,:0.4):0.5):0.0; all have a distance to parent (A:0.1,B:0.2,(C:0.3,D:0.4):0.5); distances and leaf names (popular) (A:0.1,B:0.2,(C:0.3,D:0.4)E:0.5)F; distances and all names ((B:0.2,(C:0.3,D:0.4)E:0.5)F:0.1)A; a tree rooted on a leaf node (rare)

Newick format is typically used for tools like PHYLIP and is a minimal definition for a phylogenetic tree.

Rooted, unrooted, and binary trees When an unrooted tree is represented in Newick notation, an arbitrary node is chosen as its root. Whether rooted or unrooted, typically a tree's representation is rooted on an internal node and it is rare (but legal) to root a tree on a leaf node. A rooted binary tree that is rooted on an internal node has exactly two immediate descendant nodes for each internal node. An unrooted binary tree that is rooted on an arbitrary internal node has exactly three immediate descendant nodes for the root node, and each other internal node has exactly two immediate descendant nodes. A binary tree rooted from a leaf has at most one immediate descendant node for the root node, and each internal node has exactly two immediate descendant nodes.

Grammar A grammar for parsing the Newick format (roughly based on ):

The grammar nodes Tree: The full input Newick Format for a single tree Subtree: an internal node (and its descendants) or a leaf node Leaf: a node with no descendants Internal: a node and its one or more descendants BranchSet: a set of one or more Branches Branch: a tree edge and its descendant subtree. Name: the name of a node Length: the length of a tree edge.

The grammar rules Note, "|" separates alternatives.

Tree → Subtree ";" Subtree → Leaf | Internal Leaf → Name Internal → "(" BranchSet ")" Name BranchSet → Branch | Branch "," BranchSet Branch → Subtree Length Name → empty | string Length → empty | ":" number

Whitespace (spaces, tabs, carriage returns, and linefeeds) within number is prohibited. Whitespace within string is often prohibited. Whitespace elsewhere is ignored. Sometimes the Name string must be of a specified fixed length; otherwise the punctuation characters from the grammar (semicolon, parentheses, comma, and colon) are prohibited. The Tree → Subtree ";" production is instead the Tree → Branch ";" production in those cases where having the entire tree descended from nowhere is permitted; this captures the replaced production as well because Length can be empty. Note that when a tree having more than one leaf is rooted from one of its leaves, a representation that is rarely seen in practice, the root leaf is characterized as an Internal node by the above grammar. Generally, a root node labeled as Internal should be construed as actually internal if and only if it has at least two Branches in its BranchSet. One can make a grammar that formalizes this distinction by replacing the above Tree production rule with

Tree → RootLeaf ";" | RootInternal ";" RootLeaf → Name | "(" Branch ")" Name RootInternal → "(" Branch "," BranchSet ")" Name

The first RootLeaf production is for a tree with exactly one leaf. The second RootLeaf production is for rooting a tree from one of its two or more leaves.

Notes An unquoted string may not contain blanks, parentheses, square brackets, single_quotes, colons, semicolons, or commas. Underscore characters in unquoted strings are converted to blanks. A string may also be quoted by enclosing it in single quotes. Single quotes in the original string are represented as two consecutive single quote characters. Whitespace may appear anywhere except within an unquoted string or a Length Newlines may appear anywhere except within a string or a Length. Comments are enclosed in square brackets. They can appear anywhere newlines are allowed. Comments starting with & are generally computer-generated for additional data. Some dialects allow nested comments.

Escaping Node labels must be escaped before writing them as Newick. The following examples show how a node label (on the left) is transformed before writing (on the right).

abc → abc a b → a_b or 'a b' a_b → 'a_b' a (b → 'a (b' a()[],; : -> 'a()[],; :' a'b → 'a''b' a''b → 'a''''b' The reverse transformation must be performed when reading a Newick tree. Software that doesn't implement these transformations does not correctly implement the Newick format.

Dialects

New Hampshire X format The New Hampshire X (NHX) format is an extension to Newick that adds key-value data (gene duplication, etc.) to Newick nodes. This is done by putting the additional data in square brackets [&&NHX:key=value:...] in the node labels. The brackets are used because they represent comments in the Nexus file format, so any parser not understanding these additional information will ignore them.

Node and Branch annotations Some phylogenetic software distinguishes node and branch annotations. Whereas the standard Newick format is:

<node_label>:<branch_length>

node and branch annotations can be distinguished by placing node attributes before the colon, and branch attributes after the colon:

node4[&node_age=10,node_color=blue]:[&branch_posterior_probability=0.7]1.0

or

node4[&node_age=10,node_color=blue]:1.0[&branch_posterior_probability=0.7]

… excerpt ends here. Continue reading the full article.

Illustrations

Newick format illustration
Newick format illustration

Worked examples

Example 1 — a first encounter with Newick format

Start with the simplest possible case. Write down what Newick format claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In biology, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Newick format before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Newick format ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Newick format

In research
Newick format appears in biology research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Newick format in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Newick format is common in secondary-school and first-year university syllabi. It links to neighbouring topics Graph description languages, Phylogenetics, Trees (data structures), so understanding it makes those chapters shorter.
In everyday life
Look for Newick format outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Newick format” →

How to study Newick format in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Newick format means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Newick format out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Newick format in simple terms?

In mathematics and phylogenetics, Newick tree format (or Newick notation or New Hampshire tree format) is a way of representing graph-theoretical trees with edge lengths using parentheses and commas. It was adopted by James Archie, William H.

Why does Newick format matter?

Because it connects several biology ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Newick format?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Newick format.

Tags

  • Graph description languages
  • Phylogenetics
  • Trees (data structures)

Keep exploring