Date: 2009-04-23 02:49 Sender: Brian O'MearaOriginally, NCL just stored trees as newick strings (still does as one of the options). There are now options for parsing the tree on load. It is stored as a vector of node objects (with things like edge lengths), leaves, and other info (see <http://ncl.svn.sourceforge.net/viewvc/ncl/branches/v2.2/ncl/nxstreesblock.h?revision=433&view=markup>).
NCL doesn't have a lot of tree parsing stuff, but there is some. We already use C++ code on the NCL side to do a lot of the processing to get data into phylobase. RCpp (at least with the version used during the hackathon) had a very limited set of kinds of objects that could be passed from C++ to R, so at least one place we create a string of R code on the C++ side and then eval it in R to get the data structures. We could add tree parsing on the C++ side to and do a similar trick (though chime in if you know better ways of doing this). |
Date: 2009-04-23 00:18 Sender: François MichonneauActually NCL is used to extract from the nexus file the string of characters which matches to the tree. However, phylobase uses ape's functions to parse this string of character into a phylo(4) object. One of these function in written in C, the other 2 in R. In my experience, readNexus is really fast even for big files.
I just thought it would be good idea to package these functions as part of phylobase. |