BioJS Newick Parser
How to build it
npm i npm startnpm test
Documentation
Now include biojs-io-newick.min.js in the build folder into your html (see example.html).
Just call method parse_newick(string)
for parsing a newick string into JSON.
var parser = ;parser;
Call the method parse_nhx(string)
for parsing an extended newick formats into JSON.
var parser = ;parser;
Call the method parse_json(string)
for parsing a json string back into newick format.
var parser = ;parser;
Newick format:
F
Converted to JSON:
name : "F" children: name: "A" branch_length: 01 name: "B" branch_length: 02 name: "E" length: 05 children: name: "C" branch_length: 03 name: "D" branch_length: 04
Contributions
Kudos to @alanrice for the parse_json
method