Patristic Inference library for Node and Browser
npm install patristicpatristic is a javascript toolkit for working with phylogenies. It can:
* Parse newick into
Javascript objects representing the phylogenetic tree
* Run rapid neighbor joining
to compute a phylogenetic tree from a distance matrix
* Infer a patristic distance matrix
from a phylogenetic tree
* Reroot a tree on any given Branch
* Infer directionality between two Branches in the tree
* ...And quite a bit more.
To install patristic with NPM use: npm install --save patristic
Please note that this is a beta-stage API and may change (possibly dramatically)
in the very near future.
``javascript`
var newick = "(A:0.1,B:0.2,(C:0.3,(D:0.4,E:0.6):0.1):0.5);";
var tree = patristic.parseNewick(newick);
We can use this tree to compute a patristic distance matrix.
`javascript`
var matrix = tree.toMatrix();
Note that elements in the tree object maintain references to their parents,
creating circular references. If you need a tree without circular references for
serialization:
`javascript`
tree.toObject();
(tree.toJSON aliases that, so you can JSON.stringify` a Branch and it just
works. ๐)
For more details, check out our Full Documentation.
This source code in this repository is free: you can redistribute it and/or
modify it under the terms of the Apache Software License version 2, or (at your
option) any later version.
This source code in this repository is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache Software
License for more details.
You should have received a copy of the Apache Software License along with this
program. If not, see http://www.apache.org/licenses/LICENSE-2.0.html
The source code forked from other open source projects will inherit its license.
All comments, messages, pull requests, and other submissions received through
CDC including this GitHub page are subject to the Presidential Records Act
and may be archived. Learn more at http://www.cdc.gov/other/privacy.html.