guangchuangyu / libnewicktree Goto Github PK
View Code? Open in Web Editor NEWThis project forked from cjb/libnewicktree
A standalone Newick tree reader in Java
Home Page: http://exploretree.org/
This project forked from cjb/libnewicktree
A standalone Newick tree reader in Java
Home Page: http://exploretree.org/
What's this? ============ It's a Newick tree parser: http://en.wikipedia.org/wiki/Newick_format This code is *entirely* taken from the TreeJuxtaposer project at: http://olduvai.sourceforge.net/tj/index.shtml I refactored the code to separate UI drawing from parsing and Tree creation, so this code is purely for Newick parsing and tree generation. How can I use it? ================ You could do something like this: Tree treeoflife; int current_depth = 0; void setup() { BufferedReader r = createReader("treeoflife.tree"); TreeParser tp = new TreeParser(r); treeoflife = tp.tokenize(1, "treeoflife", null); int tree_height = treeoflife.getHeight(); System.out.println("largest tree height is: " + tree_height); recursive_print(0, 0); } void recursive_print (int currkey, int currdepth) { TreeNode currNode = treeoflife.getNodeByKey(currkey); int numChildren = currNode.numberChildren(); for (int i = 0; i < numChildren; i++) { int childkey = currNode.getChild(i).key; TreeNode childnode = treeoflife.getNodeByKey(childkey); System.out.println("child name is: " + childnode.getName() + " depth is: " + currdepth); recursive_print(childkey, currdepth+1); } } Who uses it? ============ The need for a standalone parser came from the tree explorer at: http://exploretree.org/ What license is it available under? =================================== The TreeJuxtaposer code is under the BSD license, so this code is too. Who should I contact with a bug report? ======================================= Since I stripped out anything that wasn't necessary for exploretree, you could first see if what you need is present in the main TreeJuxtaposer source. If the bug is only in this library, please contact me at [email protected] instead of bugging the TreeJuxtaposer folks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.