[Phylobase-devl] NCL and Mr. Bayes output
Brian O'Meara
bcomeara at nescent.org
Mon Apr 14 19:24:18 CEST 2008
Actually, for trees, the NCL stores them internally as Newick
strings, plus a vector describing whether they are rooted and a
vector with tree names [Rod Page's TreeLib converts trees into nodes
with parent-offspring-sibling information, but that's distinct from
the NCL]. For character data, the internal representation (see
nxscharactersblock.h) is a matrix, but it can deal with polymorphism/
uncertainty and gaps, as well as (in theory, I haven't tried this
yet, and it's new) whether continuous characters are means for a
species, max/min values, etc. Because NCL has built-in functions for
dealing with parsing this internal rep (telling whether a site is
polymorphic, for example, or linking a state number (0) to a state
value (A, like for DNA)), I opted to do the processing of the matrix
within the NCL. As to why use eval, rather than passing back the
dataframe, I think there was an issue with what format of things
Rcpp, the C++/R connector package, could pass from C++ to R, and so
this was the obvious way to deal with it. I also just found that Rcpp
has been moved to R-forge in March 2008 ( http://r-forge.r-
project.org/projects/rcpp/ ), so perhaps such limitations are being/
have been fixed.
Brian
On Apr 14, 2008, at 11:40 AM, Hilmar Lapp wrote:
>
> On Apr 14, 2008, at 11:07 AM, Brian O'Meara wrote:
>> The way we're using the NCL in phylobase is to pass the file name to
>> the C++ code, load the file, parse it (which entails storing the taxa
>> names in one block object, trees in another, data in a third), and in
>> the case of trees pass back basically what would be an exported
>> simple nexus tree file that is then read with a modified read.nexus,
>> and in the case of data is passed back as the internal R
>> representation for the data as a text string that is then eval'ed
>
>
> Could the tree not be passed back as the internal structure (i.e.,
> the edge matrix), and similarly for the data?
>
> -hilmar
> --
> ===========================================================
> : Hilmar Lapp -:- Durham, NC -:- hlapp at duke dot edu :
> ===========================================================
>
>
>
>
More information about the Phylobase-devl
mailing list