Skip to content

Instantly share code, notes, and snippets.

@Zsailer
Last active August 3, 2017 23:21
Show Gist options
  • Save Zsailer/d9942daab28c8e167608916ea0c5f478 to your computer and use it in GitHub Desktop.
Save Zsailer/d9942daab28c8e167608916ea0c5f478 to your computer and use it in GitHub Desktop.
Towards defining a tree JSON format

Towards defining a (phylogenetic) tree JSON Format

After a fair bit of digging, I was unable to find a single, defined JSON structure for phylogenetic data. With awesome visualization libraries (like D3) emerging, I think it is necessary to standardize a JSON grammar to allow libraries like DendroPy to access such visualizations.

In this document, I attempt to define this set of rules and grammar.

Metadata Keys

name meaning type required
name name of the organism. string X
length length of branch from parent to node float
childen array of children nodes array
id free id to be used by any program string
accver NCBI accession number string
sequence raw sequence string
taxonomy sub-JSON tree of taxonomy JSON object
score score at node float

Visualization Keys

name meaning type required
color name of the organism. string
label node label for visualization string

Rules

{
"name": "root",
"children": [{
"name": "child1",
}, {
"name": "child2",
"children":[{
"name": "child1-1",
},{
"name": "child1-2",
}],
}, {
"name": "child3",
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment