Skip to content

3. Summarize PyRate results

Daniele edited this page May 13, 2015 · 14 revisions

Description of the output files

A typical PyRate analysis produces three output files:

_*sum.txt Text file providing the complete list of settings used in the analysis.
_*mcmc.log

Tab-separated table with the MCMC samples of the posterior, prior, likelihoods of the preservation process and of the birth-death (indicated by PP_lik and BD_lik, respectively), the preservation rate (q_rate), the shape parameter of its gamma distributed heterogeneity (alpha), the parameters of the Covar model (cov_sp, cov_ex, cov_q), the number of sampled rate shifts (k_birth, k_death; only logged in BDMCMC analyses), the value of scaling factor used in TI analyses (beta), the time of origin of the oldest lineage (root_age), the speciation/ extinction rates between shifts (lambda_0, lambda_1, ... and mu_0, mu_1, ...; only logged under fixed number of shifts, i.e. with -A 0 or -A 1), the times of rate shifts in speciation and extinction (shift_sp_1, ... and shift_ex_1, ...; only logged with -A 0 or -A 1), the total branch length (tot_length), and the times of speciation and extinction of all taxa in the data set (*_TS and *_TE, respectively). This file can be used to calculate the sampling frequencies of birth-death models with different number of rate shifts after a BDMCMC analysis using the function -mProb (see section Plot/summarize results). Additionally, the file can be opened in the program Tracer to check the efficiency and mixing of the MCMC and the proportion of burnin.

_*marginal_rates.log

Tab-separated table with the posterior samples of the marginal rates of speciation, extinction, and net diversification, calculated within 1 time unit (typically Myr). This file can be used to generate rates-through-time plots using the function -plot (see section Plot/summarize results).

When running an analysis to estimate the marginal likelihood of a birth-death model by TI (option -A 1) the ‘*_marginal_rates.log’ file is replaced by the following:

_*marginal_likelihood.txt

Text file providing the marginal likelihood of a birth-death model estimated by TI. This value can be used to compare the relative fit of different birth-death model (e.g. with different number of shifts, fixed shift ages, trait-correlated rates using the Covar model, ...). The calculation of Bayes Factors to quantify the relative model support can be done using the command -BF described below.


Plot/summarize results

-plot

This function takes the marginal speciation and extinction rates logged by a PyRate analysis in one or more files (named ‘_marginal_rates.log’) and generates a rates-through-time plot (RTT) using the scripting language R. Two output files are generated: an R script named ‘_RTTplot.r’ and a pdf file named ‘_RTTplot.pdf’. The former contains the source R code for generating the graphic output saved in the pdf file. As for all the other input files, by default these files will be save in the same directory as the input file. Marginal speciation, extinction, and net diversification rates through time are plotted in 1 Myr time bins with the respective 10, 50, and 95% HPDs. The -plot function takes as argument the path to the directory containing the ‘_marginal_rates.log’ file(s). By default, it take all ‘_marginal_rates.log’ in the specified directory and combined in a single plot. To specify which files should be combined (if not all) you can use the command -tag described below. The proportion of burnin to be excluded can be specified using the command -b (by default set to 0). We recommend to inspect the ‘_marginal_rates.log’ file in Tracer to define the appropriate proportion of burnin. Example: -plot path_to_pyrate_results

-tag

Specify which files should be combined in the RTT plot. For example if set to -tag rhinos, all ‘*_marginal_rates.log’ files containing the word ‘rhinos’ will be combined, whereas other files will be ignored.

-mProb

Takes the posterior samples logged in a BDMCMC analysis to a file (named ‘_mcmc.log’) to calculate the sampling frequencies of birth-death models with different number of rate shifts after a BDMCMC analysis. The proportion of burnin to be excluded can be specified using the command -b (by default set to 0). We recommend to inspect the ‘_mcmc.log’ file in Tracer to define the appropriate proportion of burnin. Example: -mProb file_name_mcmc.log

-BF

Takes the marginal likelihoods calculated under two birth-death models (from ‘*_marginal_likelihood.txt’ files) to calculate Bayes Factors and quantify the support of one model against the other. The Bayes factor is calculated as twice the difference of log marginal likelihood and the degree of support divided into four categories: negligible, positive, strong, very strong, based on Kass and Raftery (1995).
Example: -BF path_to_file/file_1_marginal_likelihood.txt path_to_file/file_2_marginal_likelihood.txt

Clone this wiki locally