newick_to_graphml
Convert from any graph formatto newick_to_graphml Convert from newick_to_graphmlto any other format
newicktographml is a small open-source utility by Gildas Lepennetier for converting phylogenetic trees stored in the Newick format (Newick) into GraphML (GraphML), the XML-based graph interchange language read by Cytoscape (Cytoscape) and many other network tools. The motivation is practical: Newick is the near-universal serialization for phylogenetic trees but encodes only nested topology and branch lengths, whereas GraphML can carry arbitrary typed node and edge attributes, making a tree amenable to network-style visualization, styling, and annotation.
The tool is a two-stage command-line pipeline mixing Python and R rather than a single monolithic program. A Python step, newickfixInternalnodes.py, first walks the tree and assigns explicit identifiers to internal (unlabeled) nodes from their index, since Newick leaves internal vertices anonymous and GraphML requires every node to have an id. An R script, newick2graphml.R, then performs the actual conversion. On the Python side it depends on Biopython (Biopython, Python 3.3+); on the R side it uses ape, phytools, and igraph — ape's read/tree structures and igraph's graph model do the heavy lifting of turning the rooted tree into a node-and-edge graph that is written out as GraphML.
Conceptually the output is a directed acyclic graph: each clade and each tip becomes a node, parent-to-child branches become edges, and branch lengths can be attached as edge attributes. Because the R script is short and readable, the author explicitly intends users to edit it — for example to add annotation columns keyed on node names, or to attach colours and other visual properties that GraphML supports and Cytoscape can then map to styles.
Its main significance is as a documented bridge into the Cytoscape ecosystem: the approach was folded into official Cytoscape/RCy3 material, though that vignette ultimately favours a pure-R route (phytools::read.newick, ape::as.igraph.phylo, igraph edge attributes, createNetworkFromIgraph). Limitations are those of a research script: it is a non-commercial, as-is utility with no guarantees, requires both a Python and an R toolchain, needs executable permissions set manually, and lacks packaging or tests. For richer phylogenetic interchange, XML formats such as phyloXML and NeXML carry metadata that a plain Newick-to-GraphML pass discards, and general-purpose converters like NetworkX or GraphInOut cover broader format matrices.
Input Formats
Output Formats
Frequently Asked Questions
What graph file formats does newick_to_graphml support?
See the list on this page — it shows every format newicktographml can read, write and display.
How do I import a graph into newick_to_graphml?
Convert your file to a format newicktographml can read, then open it in newicktographml. Use GraphInOut to get a newicktographml-compatible file in seconds.
How do I convert a file so newick_to_graphml can open it?
Use the convert links above — upload or paste your graph, pick a format newicktographml accepts and download the result, right in your browser.