[Biojava-l] The root node is missing when parsing nexus tree files from MrBayes

Tiago Antão tiagoantao at gmail.com
Tue Jan 25 17:42:29 UTC 2011


I think the patch that I submitted to the old newick module of biojava
never really was released by the biojava team. So that example will
not work with biojava (unless you track the svn release with the patch
and use that, arguably not a good solution).

More info can be supplied by the biojava maintainers. I just made the
patch and the example.

On Tue, Jan 25, 2011 at 5:35 PM, Martin Jones <martin.jones at ed.ac.uk> wrote:
> Hi,
>
> I am using some of the code from here:
>
> http://tiago.org/cc/2009/11/17/reading-newicknexus-phylogenetic-trees-with-biojava/
>
> to parse nexus phylogenetic tree data. My nexus file is output from MrBayes:
>
> ------------------ snip-----------------
> #NEXUS
>
> [ID: 7166567671]
> begin trees;
>   [Note: This tree contains information on the topology,
>          branch lengths (if present), and the probability
>          of the partition indicated by the branch.]
>   tree con_50_majrule =
> (27563:0.194008,(6843:0.233188,6960:0.229043)0.98:0.117649,(61985:0.217735,6657:0.275071)0.89:0.089314);
>
>   [Note: This tree contains information only on the topology
>          and branch lengths (mean of the posterior probability density).]
>   tree con_50_majrule =
> (27563:0.194008,(6843:0.233188,6960:0.229043):0.117649,(61985:0.217735,6657:0.275071):0.089314);
> end;
>
> -------------------------- snip -------------
>
> the file parses without any error, but when I get a list of vertices,
> the first one (27563) is missing:
>
> def tree = getTree(nexus, 'con 50 majrule')
> tree.vertexSet().each{
>  println it
> }
>
> output:
>
> 6843
> p1
> 6960
> 61985
> p3
> 6657
> p2
>
> ______________snip ___________
>
> The above code is Groovy, but hopefully is self-explanatory. Is the
> first node being treated specially because it is the root? If so, can
> I get it using some other method?
>
> Thanks,
>
> Martin
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-l
>



-- 
"If you want to get laid, go to college.  If you want an education, go
to the library." - Frank Zappa




More information about the Biojava-l mailing list