How to get latest version of treeannotator.jar?

446 views
Skip to first unread message

Roger Close

unread,
Dec 10, 2015, 8:19:24 AM12/10/15
to beast-users
Hi all,

In the past, we Mac users could obtain the treeannotator.jar file from within the bowels of TreeAnnotator.app. However, it doesn't seem to be present in the BEAST 2.3.1 release. Where might we find the latest version of this file?

Many thanks,
Roger

Remco Bouckaert

unread,
Dec 10, 2015, 12:26:05 PM12/10/15
to beast...@googlegroups.com
Hi Roger,

TreeAnnotator is wrapped up in beast.jar, which on OSX is in the /Applications/BEAST\ 2.3.1/lib/ directory.

To run TreeAnnotator on the command line, you can either run 

/Applications/BEAST\ 2.3.1/bin/treeannotator 

or directly from the jar using

java -cp /Applications/BEAST\ 2.3.1/lib/beast.jar beast.app.treeannotator.TreeAnnotator

Running it with -help as argument shows how to use it:


              TreeAnnotator v2.3.1, 2002-2015
                    MCMC Output analysis
                             by
           Andrew Rambaut and Alexei J. Drummond

             Institute of Evolutionary Biology
                  University of Edinburgh
                     a.ra...@ed.ac.uk

               Department of Computer Science
                   University of Auckland
                  ale...@cs.auckland.ac.nz


  Usage: treeannotator [-heights <keep|median|mean|ca>] [-burnin <i>] [-b <i>] [-limit <r>] [-target <target_file_name>] [-help] [-forceDiscrete] [-lowMem] [-hpd2D <r>] <input-file-name> [<output-file-name>]
    -heights an option of 'keep' (default), 'median', 'mean' or 'ca'
    -burnin the percentage of states to be considered as 'burn-in'
    -b the percentage of states to be considered as 'burn-in'
    -limit the minimum posterior probability for a node to be annotated
    -target specifies a user target tree to be annotated
    -help option to print this message
    -forceDiscrete forces integer traits to be treated as discrete traits.
    -lowMem use less memory, which is a bit slower.
    -hpd2D the HPD interval to be used for the bivariate traits

  Example: treeannotator test.trees out.txt
  Example: treeannotator -burnin 10 -heights mean test.trees out.txt
  Example: treeannotator -burnin 20 -target map.tree test.trees out.txt


Cheers,

Remco


--
You received this message because you are subscribed to the Google Groups "beast-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beast-users...@googlegroups.com.
To post to this group, send email to beast...@googlegroups.com.
Visit this group at http://groups.google.com/group/beast-users.
For more options, visit https://groups.google.com/d/optout.

Roger Close

unread,
Dec 10, 2015, 12:58:40 PM12/10/15
to beast-users
Hi Remco,

Brilliant, thanks for clarifying that!

On a slightly tangential note, do you know if TreeAnnotator can (or will eventually be able to) calculate MCC trees for sampled-ancestor analyses in which fossil tip-ages are not fixed?

Cheers,
Roger

Nick Matzke

unread,
Dec 10, 2015, 11:35:27 PM12/10/15
to beast...@googlegroups.com
I've used it for this, it seems to work fine -- note, though, that a tip with a high chance of being a direct ancestor won't be placed as a literal direct ancestor in the the Newick string (meaning, a node with only one descendant). Instead, it is a side-branch of length 0.  I think this is actually preferable, because then whatever data that went at the tip can be linked to it in standard ways in R etc.  It does mean that any downstream analyses you use would have to not explode due to 0-length branches. 

To make a tree where the 0-length branches are nodes with 1 descendant, one would have to use some other program.  Probably it could be done in R etc. but I haven't tried.

PS: If you want to plot an MCC tree and add 95% bars for the tip dates, you can try this R script:

Cheers,
Nick

Roger Close

unread,
Dec 11, 2015, 6:06:36 AM12/11/15
to beast-users, mat...@nimbios.org
Hi Nick,

You're right, the latest version of TreeAnnotator does indeed correctly calculate maximum sampled-ancestor clade credibility trees. I must have been using a slightly outdated .jar file, because until I accessed the latest version using Remco's advice it was rendering sampled ancestors as very short but non-zero-length terminals. Seems to be working perfectly now, though.

Cheers,
Roger
Reply all
Reply to author
Forward
0 new messages