Getting Started#

Basic Installation#

Python installation requirements#

Python 3.8.0+ is an installation requirement. To download Python, see the Python website.

Python package dependencies#

In addition to a base installation of Python, PyBrOpS relies on several dependencies. They are:

  1. numpy-1.22.2+ (for matrix storage and algebra)

  2. pandas-1.4.1+ (for data frames)

  3. scipy-1.8.0+ (for miscellaneous numerical routines)

  4. matplotlib-3.5.1+ (for graphics)

  5. pymoo-0.6.0+ (for genetic algorithms)

  6. cyvcf2-0.30.14+ (for reading VCFs)

  7. h5py-3.6.0+ (for HDF5 file support)

The following additional packages are also required for the developmental installation of PyBrOpS:

  1. pytest-7.0.1+ (for unit testing)

  2. pytest-datadir-1.3.1+ (for unit testing)

  3. setuptools (for package building)

  4. wheel (for package building)

Release version installation#

PyBrOpS is available on pip and can be installed using the pip command.

$ pip install pybrops

Basic Programming Knowledge Prerequisites#

PyBrOpS makes several programming knowledge assumptions of the user. Below is a table of these knowledge prerequisites and a link to a refresher course if you need to understand the basics.

PyBrOpS Programming Knowledge Prerequisites#

Knowledge Prerequisite

Importance

Refresher Course

The Python Programming Language

Essential

See The Python Tutorial

NumPy arrays

Essential

See The NumPy User Guide

Pandas DataFrames

Essential

See The Pandas 10 Minute Guide

PyMOO genetic algorithms

Optional

See PyMOO.org to learn how to create custom algorithms in PyMOO’s framework.

Using PyBrOpS#

If you desire to start making your own breeding simulations immediately and want to see complete, working simulation scripts, see the examples.

If you desire to gain a more in-depth knowledge about how PyBrOpS works before embarking on creating your own simulation scripts, see the fundamentals to understand PyBrOpS’s design philosophy, followed by the standard usage section.

Advanced Installation#

The following sections detail advanced installation instructions for developing on Linux systems or working with the developmental version of PyBrOpS.

Linux installation requirements#

On Linux, you will need to install Python developmental headers in addition to Python 3.8.0+. Even though PyBrOpS is written in pure Python, some of its dependencies require compilation.

Below are the commands for installing Python developmental headers:

Linux Developmental Library Installation Commands#

Linux Distro

Command

Fedora

sudo dnf install python3-devel

Ubuntu

sudo apt install python3-dev

Developmental version installation#

To install the developmental version, first clone the repository:

$ git clone https://github.com/rzshrote/pybrops.git

It is a best practice to create a virtual environment where PyBrOpS dependencies can be installed. To do this, you can use the Makefile:

$ make install-devel

Alternatively, this may be done manually using the following commands:

$ python3 -m venv env
$ . env/bin/activate
$ python3 -m pip install --editable .

Next, you must activate the virtual environment using either the . command (for sh) or the source command (for bash):

$ . env/bin/activate

or

$ source env/bin/activate

Now that the virtual environment is activated, you can access pybrops through the python3 command-line interface prompt and through script execution.