Below please find source codes and raw result files that were used to generate the results reported in:
Mayrose et al. 2011. Recently-formed polyploid plants diversify at lower rates. Science. 333(6047):1257. [abs].

Diversification analysis

Download R source code and example

This R script was used to conduct the BiSSE analyses described in Mayrose et al. (2011), with improved code annotation and readability, plus some minor clean up. This script originally depended on diversitree version 0.7.3. Diversitree is currently at version 0.9-7. Several lines of code were updated so that the script can be run using version 0.9-7. It is not backward-compatible.

Example

The provided example contains example input and output files.
The outputs were generated with the following command:
R CMD BATCH --no-save --no-restore '--args working_dir="./" tree_file="Gagea.mb_trees" state_file="Gagea.ploidy" prior_use=1 tree_num=10 sampling.f=0.707 fix.root.0=0 constr.q10=1 lower.q10=0' ../BisseScript-v1.8.1.R example.Rout

Inputs

a) Gagea.ploidy
'Gagea.ploidy' contains per-taxon ploidy levels (0 = diploid; 1 = polyploid; NA = not available or unknown).
b) Gagea.mb_trees
'Gagea.mb_trees' is a Newick-formatted file containing ultrametric trees, which could be a set of randomly shuffled post burn-in MrBayes trees.
The file in this package was taken from the database deposited in Dryad (http://datadryad.org/resource/doi:10.5061/dryad.6hf21).

Outputs

a) results.txt
Output file containing post burn-in MCMC samples. The main results (%(spec0>spec1), %(ext0>ext1), PP(div0>div1)) can be derived by using the data in the last three columns.
b) figures.pdf
Output file containing figures summarizing the results in 'results.txt'. These include a tree indicating which taxa are diploid (BLUE) and which are polyploid (RED). Histograms showing the posterior distributions (PD) of the model parameters (spec0, spec1, ext0, ext1, q01, q10), and histograms showing the PD of the differences between certain parameters (e.g., spec0 and spec1).
c) log.txt
Output file containing input arguments used. Warnings and errors, if any, are also printed to this file in addition to the '*.Rout' file


Simulation analysis

Download simulatePP C++ source codes

simulatePP is a small program to simulate the number of polyploidization events expected within an angiosperm species.
Details regarding these simulations are provided in
(1) Mayrose et al. 2011. Recently-formed polyploid plants diversify at lower rates. doi 10.1126/science.1207205
(2) Mayrose et al. 2015. Methods for studying polyploid diversification and the dead end hypothesis: a reply to Soltis et al. (2014)

The simulation starts with a single diploid ancestor and run until the specified number of lineages is reached. At each iteration of the simulation, a random species is selected to speciate or to go extinct, with extinction happening with probability mu/(mu + lambda), where mu is the extinction rate and lambda is the speciation rate, and speciated otherwise. At each speciation event, the daughter species is polyploidized with probability f_het (the input polyploid speciation frequency) and thus its ploidal level is increased by one relative to the sister and ancestor lineages.

To compile the program simply use the provided Makefile or the pre-compiled Linux binary "simulatePPLinux".
To run the program type
simulatePP

For example, type the following command to make 100 simulations for a clade of 300,000 lineages with relative extinction rate of 0.6 and polyploid speciation frequency of 0.15.
>simulatePP 0.6 0.15 300000 100 test

The directory test will contain each of the 100 simulations and a summary file "summary.txt" that contains the averages and std's for each ploidal level over all simulation runs. pp_level = 1 means diploid, pp_level = 2 means a single whole genome duplication, etc.


Supporing Tables

The two Comma-separated values files include the raw results that were used to generate Tables S2 and S3 as well as figure 1 in the main text and figure S1. Please consult the readMe file for further information.
readMe
SuppTable2.csv
SuppTable3.csv