Skip to main content

Command-line tool for simulating predictive datasets from MrBayes' output.

Project description

Build-Status License

predsim is a command-line tool for simulating predictive datasets from MrBayes output files. Datasets can be simulated under the GTR+G+I substitution model or any of its nested variants available in MrBayes (JC69, HKY85 etc.). The script uses Seq-Gen for simulating the DNA-sequences and builds on the third-party libraries DendroPy and pandas.

The code has been tested with Python 2.7, 3.3, 3.4 and 3.5.

Source repository: https://github.com/jmenglund/predsim


Requirements

Seq-Gen must be installed on your system.

Installation

For most users, the easiest way is probably to install the latest version hosted on PyPI:

$ pip install predsim

The project is hosted at https://github.com/jmenglund/predsim and can also be installed using git:

$ git clone https://github.com/jmenglund/predsim.git
$ cd predsim
$ python setup.py install

You may consider installing predsim and its required Python packages within a virtual environment in order to avoid cluttering your system’s Python path. See for example the environment management system conda or the package virtualenv.

Usage

$ predsim --help
usage: predsim [-h] [-V] [-l INT] [-g INT] [-c FILE] [-s INT] [-p FILE]
                   pfile tfile [outfile]

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
  outfile               path to output file (default: <stdout>)

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -l INT, --length INT  sequence lenght (default: 1000)
  -g INT, --gamma-cats INT
                        number of gamma rate categories (default: continuous)
  -c FILE, --commands-file FILE
                        path to output file with used Seq-Gen commands
  -s INT, --skip INT    number of records (trees) to skip at the beginning of
                        the sample (default: 0)
  -p FILE, --seqgen-path FILE
                        path to a Seq-Gen executable (default: "seq-gen")

It is strongly recommended that you use the -c FILE option to check the commands run by Seq-Gen.

Depending on your Python version, you might need to specify the full path to your Seq-Gen executable with the -p FILE option.

Running tests

Testing is carried out with pytest. Here is an example on how to run the test suite and generating a coverage report:

$ cd predsim
$ pip install pytest pytest-cov pytest-pep8
$ py.test -v --cov-report term-missing --cov predsim.py --pep8

License

predsim is distributed under the MIT license.

Author

Markus Englund, orcid.org/0000-0003-1688-7112

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

predsim-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

predsim-0.1.0-py2.py3-none-any.whl (9.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file predsim-0.1.0.tar.gz.

File metadata

  • Download URL: predsim-0.1.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for predsim-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cc8832804341529f45418a9ad7ffc75cfabd7e2f99222e0a4d50846afea7057d
MD5 7c0637481dd72fb84d1173d8fd58c488
BLAKE2b-256 2797bf364295da36d322bb44bc3563c748d2347548ce8314b6944eba86c62f71

See more details on using hashes here.

File details

Details for the file predsim-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for predsim-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c2dc4b3c06b5dde365cd134413f588d205a3a66f13b145156c626f5c3005112b
MD5 12b2e683f8b7e2255ee6543d9b65b066
BLAKE2b-256 d6856cf8b936fdc5ef1e388579278f62a5cea984f324bb1a9dec70d192e5e0e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page