SNAPP (SNP and AFLP Package for Phylogenetic analysis) is package for inferring species trees and species demographics from independent (unlinked) biallelic markers such as well spaced SNPs. It implements a full coalescent model, but uses a novel algorithm to integrate over all possible gene trees, rather than sampling them explicitly.
Like a standard BEAST analysis, a SNAPP analysis is controlled using a specially formatted XML file. This file can be created from scratch, or by using the graphical user interface in BEAUTi. After setting up the analysis in BEAUTi you can take the XML file and use it to run BEAST on any computer or server.
Like BEAST and MrBayes, a SNAPP analysis does not output a single tree. Rather, it uses Markov chain Monte Carlo (MCMC) to generate multiple trees (and corresponding parameter values), each of which is a sample from the posterior distribution of species trees and parameters. The trees and parameter values are output as two files. As with all MCMC analyses, care must be taken when interpreting these outputs. For example, it is necessary to check convergence and be prepared to consider multiple plausible species trees, instead of just one. The file containing parameter values can be analysed using the Tracer software. As with all MCMC software, it is advisable to run multiple analyses, possibly tweaking proposal parameters, to validate an analysis.
SNAPP is built on top of Beast 2. More information on Beast 2 can be obtained at Beast 2 web site.
SNAPP requires BEAST to be installed (download from https://beast2.org) . Once BEAST is installed, installing SNAPP is simply a matter of starting BEAUti (part of BEAST) and select the File/Manage packages menu. A list appears from which you select SNAPP — then hit the install button.
Within the SNAPP package will be the following directories:
doc/ Documentation of SNAPP examples/ Some NEXUS and XML files lib/ Java & native libraries used by SNAPP templates/ Templates to initiate BEAUti
A program called “BEAUti” will import data in NEXUS format, allow you to select various models and options and generate an XML file ready for use in SNAPP.
To run BEAUti simply double-click the “BEAUti” icon in the SNAPP folder. If this doesn’t work then you may not have Java installed correctly. Try opening an terminal/command prompt and typing:
java -cp lib/SNAPP.jar beast.app.beauti.Beauti
To run a SNAPP analysis simply double-click the BEAST icon. You will be asked to select a SNAPP XML input file.
Alternatively open a terminal/Command window and type:
java -jar lib/beast.jar input.xml
Where “input.xml” is the name of a SNAPP XML format file. This file can either be created from scratch using a text editor or be created by the BEAUti program from a NEXUS format file.
DensiTree is provided with BEAST to visually analyse tree sets. It can be used to draw trees where branch width indicate population sizes.
Furthermore, TreeSetAnalyser is provided with SNAPP to analyse tree sets. It takes as input a tree set produced by SNAPP, and compares with a tree if provided (e.g. the original used to simulate data from). It Outputs
- Size of the 95% credible set.
- Probabilities of the top 20 (?) trees
- Whether or not the true tree is in the credible set.
Also, if a tree is provided, population sizes for the branches in the tree will be printed. By running TreeSetAnalyser once (without tree argument) a topology can be selected. Running the TreeSetAnalyser again, but now with a tree argument will show population sizes.
To start TreeSetAnalyser, open the BEAST AppStore (double click the AppStore icon) and a window pops up where you can select applications. TreeSetAnalyser is one of them. Double click the TreeSetAnalyser icon and TreeSetAnalyser will be started.
A powerful graphical program for analysing MCMC log files (it can also analyse output from MrBayes and other MCMCs). This is called ‘Tracer’ and is available from the Tracer web site:
Alternatively, LogCombiner & TreeAnnotator distributed with Beast can be used. LogCombiner can combine log or tree files from multiple runs of SNAPP into a single combined results file (after removing appropriate burn-ins). TreeAnnotator can summarize a sample of trees from SNAPP using a single target tree, annotating it with posterior probabilities, HPD node heights and rates. This tree can then be viewed in a new program called ‘FigTree’ which is available from:
Support & Links
SNAPP is an extremely complex program and as such will inevitably have bugs. Discussion can be found on the BEAST mailing list.
Source code distributed under the GNU Lesser General Public License: code
Unfortunately, we have absolutely no funding for this project at the moment, but are implementing improvements and bug fixes as time permits. This is an open source project, and we strongly encourage you to get involved if there are some features you’d like to see added.
Below is a (partial) list of work planned.
- Allow inclusion of constant characters in BEAUTI.
- More extensive corrections for acquisition biases.
- Inclusion of sequence error corrections.
Bryant, David, Remco Bouckaert, Joseph Felsenstein, Noah A. Rosenberg, and Arindam RoyChoudhury. “Inferring species trees directly from biallelic genetic markers: bypassing gene trees in a full coalescent analysis.” Molecular biology and evolution 29, no. 8 (2012): 1917-1932.
Thanks for supplying code or assisting with the creation or testing of SNAPP 2 development team.