This is an archived static version of the original phylobabble.org discussion site.

Extending NEXUS TREE block

david_bryant

Hello,

I need to have some way to include information on trees (e.g. score, Posterior Probability etc.) in NEXUS tree blocks, as part of SplitsTree. Does anyone know of other software which does this:- I’m specifically interested in the NEXUS format and not just extended NEWICK. I’d like to IO files that can be shared with other software (we’d have a newick/phylip importer and exporter built in).

cheers,

David.

rutgeraldo

Hi David,

may I suggest you consider using NeXML (http://www.nexml.org)? It has an annotation mechanism that was designed for such use cases, whereas extending NEXUS would yield a dialect that is probably going to be inaccessible for a lot of other NEXUS readers, precluding true interoperability.

Best wishes,

Rutger

GrahamJones

You could look at TreeAnnotator as supplied with BEAST which uses NEXUS. I can’t make the preformatted text option here work for more than one line, so here’s one line.

tree TREE1 = [&R] (2[&length_range={1.8535875112778622E-6,0.013618234368958357},length_95%_HPD={1.8535875112778622E-6,0.0017586455552517461},height=0.0,length=5.095983931291041E-4,length_median=2.661823905940256E-4]:3.3239397262662323E-4,1[&length_range={1.8535875112778622E-6,0.013618234368958357},length_95%_HPD={1.8535875112778622E-6,0.0017586455552517461},height=0.0,length=5.095983931291041E-4,length_median=2.661823905940256E-4]:3.3239397262662323E-4)[&height_95%_HPD={1.8535875112778622E-6,0.0017586455552517461},height_median=2.661823905940256E-4,height=5.095983931291041E-4,posterior=1.0,height_range={1.8535875112778622E-6,0.013618234368958357},length=0.0];


I think the[&R] means rooted, but I guess you could add more here.

david_bryant

Cheers.

A NeXML importer/exporter would be a worthy project. I really really can’t stand XML, though it appears to be the only viable alternative to NEXUS at the moment.

-David.

arambaut

The NEXUS extensions used by BEAST/FigTree are given inside comments so that they don’t break other NEXUS readers/programs. The [&R] does denote rooted and this comes from PAUP. So I used the same convention of using an & to denote a comment with information (I call these meta comments).

The main advantage of using this format is that FigTree can recognise them.

tgvaughan

I’d just like to add that both MASTER and IcyTree also employ @arambaut’s BEAST/FigTree NEXUS extensions, so there are a growing number of precedents for this format.

alexei_drummond

Hey Tim, is there some official description of that extended Newick format that BEAST, MASTER, IcyTree use? I remember there was some room for confusion about how some types of attribute are interpreted and also the precise use and interpretation of the & sign?

tgvaughan

Hi Alexei, the link @arambaut gave in his comment is what you’re after, isn’t it?

arambaut

Just to be clear - these are NEXUS metacomment extensions. Extended Newick is different.

tgvaughan

Although, perhaps confusingly, MASTER mixes in Extended Newick as well…

In case it’s useful to anyone, I’ve put together an EBNF (to first order anyway) grammar for the tree/network strings in the NEXUS files that MASTER generates up on its wiki. Note that MASTER currently only allows for node annotations, not branch annotations, and this is reflected in the grammar.