Package: predsim
predsimis a simple command-line tool for simulating predictive
datasets fromMrBayes’output files.
Datasets can be simulated under the GTR+G+I substitution model or any nested
variant available in MrBayes (JC69, HKY85 etc.). The code is contained
within a single module that can be imported using Python’s import mechanism.
The tool usesSeq-Genfor
simulating the DNA-sequences and builds on the third-party libraryDendroPy.The code has been tested with Python 3.3 and 3.6.Source repository:https://github.com/jmenglund/predsimTable of contentsPrerequisitesInstallationUsageRunning the testsLicenseCitingAuthorPrerequisitesPython 3.3+The Python libraryDendroPy(version 4.0 or higher)The command-line toolSeq-GenAn easy way to get Python working on your computer is to install the freeAnaconda distribution.InstallationFor most users, the easiest way is probably to install the latest version
hosted onPyPI:$ pip install predsimThe project is hosted athttps://github.com/jmenglund/predsimand
can also be installed using git:$ git clone https://github.com/jmenglund/predsim.git
$ cd predsim
$ python setup.py installYou may consider installing predsim and its required Python packages
within a virtual environment in order to avoid cluttering your system’s
Python path.Usage$ predsim --help
usage: predsim [-h] [-V] [-l N] [-f #A #C #G #T] [-g N] [-s N] [-n N]
               [-o {nexus,phylip}] [-p FILE] [--seeds-file FILE]
               [--commands-file FILE] [--trees-file FILE]
               pfile tfile

A command-line utility that reads posterior output of MrBayes and simulates
predictive datasets with Seq-Gen.

positional arguments:
  pfile                 path to a MrBayes p-file
  tfile                 path to a MrBayes t-file

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -l N, --length N      sequence lenght (default: 1000)
  -f #A #C #G #T, --freqs #A #C #G #T
                        base frequences (overrides any base frequences in
                        MrBayes' output)
  -g N, --gamma-cats N  number of gamma rate categories (default: continuous)
  -s N, --skip N        number of records (trees) to skip at the beginning of
                        the sample (default: 0)
  -n N, --num-records N
                        number of records (trees) to use in the simulation
  -o {nexus,phylip}, --out-format {nexus,phylip}
                        output format (default: "nexus")
  -p FILE, --seqgen-path FILE
                        path to a Seq-Gen executable (default: "seq-gen")
  --seeds-file FILE     path to file with seed numbers (e.g. for debugging
                        purposes)
  --commands-file FILE  path to output file with commands used by Seq-Gen
  --trees-file FILE     path to output file with trees used by Seq-GenIf base frequences are missing from MrBayes’ output, these must be set manually
with the-f(or--freqs) flag.It is recommended that you use the--commands-fileand--trees-fileflags to check the input given to Seq-Gen.Running the testsTesting is carried out withpytest:$ pytest test_predsim.pyTest coverage can be calculated withCoverage.pyusing the following commands:$ coverage run -m pytest test_predsim.py
$ coverage report -m predsim.pyThe code follow style conventions inPEP 8, which can be checked
withpycodestyle:$ pycodestyle predsim.py test_predsim.py setup.pyLicensepredsim is distributed under theMIT license.CitingIf you use results produced with this package in a scientific
publication, please just mention the package name in the text and
cite the Zenodo DOI of this project:You can select your preferred citation style in the “Cite as” section
on the Zenodo page.predsim relies on other software that also should be cited. Below are
suggested citations for Seq-Gen and DendroPy:Rambaut A, Grassly NC. 1997. Seq-Gen: an application for the Monte
Carlo simulation of DNA sequence evolution along phylogenetic trees.
Comput. Appl. Biosci. 13:235–238. DOI:10.1093/bioinformatics/13.3.235Sukumaran J, Holder MT. 2010. DendroPy: a Python library for
phylogenetic computing. Bioinformatics 26:1569–1571. DOI:10.1093/bioinformatics/btq228AuthorMarkus Englund,orcid.org/0000-0003-1688-7112