Skip to main content

PyPop: Python for Population Genomics

Project description

PyPI version shields.io Build status Website pypop.org GitHub license Citations DOI

PyPop: Python for Population Genomics

PyPop is a framework for processing genotype and allele data and running population genetic analyses, including conformity to Hardy-Weinberg expectations; tests for balancing or directional selection; estimates of haplotype frequencies and measures and tests of significance for linkage disequilibrium (LD). Full documentation is available in the PyPop User Guide.

How to cite PyPop

If you write a paper that uses PyPop in your analysis, please cite both:

  • our 2024 article, currently in review, available as a Zenodo preprint:

    Lancaster AK, Single RM, Mack SJ, Sochat V, Mariani MP, Webster GD. (2024) “PyPop: A mature open-source software pipeline for population genomics” (Preprint v1). Zenodo. DOI:10.5281/zenodo.10602940.

  • and the Zenodo record for the software. To cite the correct version, follow these steps:

    1. First visit the DOI for the overall Zenodo record: 10.5281/zenodo.10080667. This DOI represents all versions, and will always resolve to the latest one.

    2. When you are viewing the record, look for the Versions box in the right-sidebar. Here are listed all versions (including older versions).

    3. Select and click the version-specific DOI that matches the specific version of PyPop that you used for your analysis.

    4. Once you are visiting the Zenodo record for the specific version, under the Citation box in the right-sidebar, select the citation format you wish to use and click to copy the citation. It will contain link to the version-specific DOI, and be of the form:

      Lancaster, AK et al. (YYYY) “PyPop: Python for Population Genomics” (Version X.Y.Z) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.XXXXX

    Note that citation metadata for the current Zenodo record is also stored in CITATION.cff

Quickstart Guide

Installing pypop-genomics

If you already have Python and pip installed, install using the following:

pip install pypop-genomics

Otherwise, follow these instructions to install Python 3 and pip.

Once pypop-genomics is installed, depending on your platform, you may also need to adjust your PATH environment variable.

Upgrading pypop-genomics

pip install -U pypop-genomics

Uninstalling pypop-genomics

pip uninstall pypop-genomics

For more, including handling common installation issues, see the detailed installation instructions .

Once you have installed pypop-genomics, you can move on to try some example runs.

Examples

These are examples of how to check that the program is installed and some minimal use cases.

Checking version and installation

pypop --version

This simply reports the version number and other information about PyPop, and indirectly checks that the program is installed. If all is well, you should see something like:

pypop 1.0.0
[Python 3.10.9 | Linux.x86_64-x86_64 | x86_64]
Copyright (C) 2003-2006 Regents of the University of California.
Copyright (C) 2007-2023 PyPop team.
This is free software.  There is NO warranty; not even for
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

You can also run pypop --help to see a full list and explanation of all the options available.

Run a minimal dataset:

Download test .ini and .pop files: minimal.ini and USAFEL-UchiTelle-small.pop. You can then run them

pypop -c  minimal.ini USAFEL-UchiTelle-small.pop

If you have already cloned the git repository and it is your working directory, you can simply run

pypop -c  tests/data/minimal.ini tests/data/USAFEL-UchiTelle-small.pop

This will generate the following two files, an XML output file and a plain text version:

USAFEL-UchiTelle-small-out.xml
USAFEL-UchiTelle-small-out.txt

Detailed installation instructions

There are three main steps:

  1. install Python and pip

  2. install package from Test PyPI

  3. adjusting your PATH variable after installation

Install Python 3 and pip

A full description of installing Python and pip on your system is beyond the scope of this guide, we recommend starting here:

https://wiki.python.org/moin/BeginnersGuide/Download

Here are some additional platform-specific notes that may be helpful:

  • Most Linux distributions come with Python 3 preinstalled. On most modern systems, pip and python will default to Python 3.

  • MacOS 10.9 (Jaguar) up until 12.3 (Catalina), used to ship with Python 2 pre-installed, but it now has to be manually installed. See the MacOS quick-start guide in the official documentation for how to install Python 3. (Note that if Python is installed on Mac via the MacOS developer tools, it may include the version 3 suffix on commands, e.g. python3 and pip3, so modify the below, accordingly).

  • For Windows, see also the Windows quick-start guide in the official documentation. Running python in the Windows command terminal in Windows 11 and later will launch the installer for the Microsoft-maintained Windows package of Python 3.

Install package from PyPI

Once you have both python and pip installed, you can use pip to install pre-compiled binary “wheels” of pypop-genomics directly from PyPI.

pip install pypop-genomics

Upgrade an existing PyPop installation

To update an existing installation to a newer version, use the same command as above, but add the --upgrade (short version: -U) flag, i.e.

pip install -U pypop-genomics

Installing from Test PyPI

From time to time, we may make available packages on the Test PyPI instance, rather than the through the main instance. The above installation and updating instructions can be used, by appending the following:

--extra-index-url https://test.pypi.org/simple/

to the above pip commands.

Issues with installation permission

By default, pip will attempt to install the pypop-genomics package wherever the current Python installation is installed. This location may be a user-specific virtual environment (like conda, see below), or a system-wide installation. On many Unix-based systems, Python will generally already be pre-installed in a “system-wide” location (e.g. under /usr/lib) which is read-only for regular users. (This can also be true for system-installed versions of Python on Windows and MacOS.)

When pip install cannot install in a read-only system-wide location , pip will gracefully “fall-back” to installing just for you in your home directory (typically ~/.local/lib/python<VER> where <VER> is the version number of your current Python). In general, this is what is wanted, so the above instructions are normally sufficient.

However, you can also explicitly set installation to be in the user directory, by adding the --user command-line option to the pip install command, i.e.:

pip install pypop-genomics --user

This may be necessary in certain cases where pip install doesn’t install into the expected user directory.

Post-install PATH adjustments

You may need to adjust the PATH settings (especially on Windows) for the pypop scripts to be visible when run from your console application, without having to supply the full path to the pypop executable file.

  • On Linux and MacOS, systems this is normally fairly simple and only requires edit of the shell .profile, or similar and addition of the $HOME/.local/bin to the PATH variable, followed by a restart of the terminal.

  • For Windows, however, as noted in most online instructions, this may need additional help from your system administrator if your user doesn’t have the right permissions, and also require a system reboot.

Uninstalling PyPop

To uninstall the current version of pypop-genomics:

pip uninstall pypop-genomics

Support and development

Please submit any bug reports, feature requests or questions, via our GitHub issue tracker (see our bug reporting guidelines for more details on how to file a good bug report):

https://github.com/alexlancaster/pypop/issues

Please do not report bugs via private email to developers.

The development of the code for PyPop is via our GitHub project:

https://github.com/alexlancaster/pypop

For a detailed description on bug reporting as well as how to contribute to PyPop, please consult our CONTRIBUTING.rst guide. For reporting security vulnerabilities visit SECURITY.md.

We also have additional notes and background relevant for developers in DEV_NOTES.md. Source for the website and the documentation is located in the website subdirectory.

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

pypop-genomics-1.0.2.tar.gz (7.1 MB view hashes)

Uploaded Source

Built Distributions

pypop_genomics-1.0.2-pp39-pypy39_pp73-win_amd64.whl (294.5 kB view hashes)

Uploaded PyPy Windows x86-64

pypop_genomics-1.0.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pypop_genomics-1.0.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl (1.3 MB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

pypop_genomics-1.0.2-pp38-pypy38_pp73-win_amd64.whl (294.3 kB view hashes)

Uploaded PyPy Windows x86-64

pypop_genomics-1.0.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.2 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pypop_genomics-1.0.2-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (1.3 MB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

pypop_genomics-1.0.2-cp312-cp312-win_amd64.whl (295.1 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

pypop_genomics-1.0.2-cp312-cp312-musllinux_1_1_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

pypop_genomics-1.0.2-cp312-cp312-musllinux_1_1_aarch64.whl (1.5 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ ARM64

pypop_genomics-1.0.2-cp312-cp312-manylinux_2_28_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.28+ x86-64

pypop_genomics-1.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.8 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

pypop_genomics-1.0.2-cp312-cp312-macosx_11_0_arm64.whl (1.1 MB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pypop_genomics-1.0.2-cp312-cp312-macosx_10_9_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

pypop_genomics-1.0.2-cp311-cp311-win_amd64.whl (294.0 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

pypop_genomics-1.0.2-cp311-cp311-musllinux_1_1_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

pypop_genomics-1.0.2-cp311-cp311-musllinux_1_1_aarch64.whl (1.5 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ ARM64

pypop_genomics-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pypop_genomics-1.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.8 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

pypop_genomics-1.0.2-cp311-cp311-macosx_11_0_arm64.whl (1.1 MB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pypop_genomics-1.0.2-cp311-cp311-macosx_10_9_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

pypop_genomics-1.0.2-cp310-cp310-win_amd64.whl (294.0 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

pypop_genomics-1.0.2-cp310-cp310-musllinux_1_1_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

pypop_genomics-1.0.2-cp310-cp310-musllinux_1_1_aarch64.whl (1.5 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ ARM64

pypop_genomics-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.4 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pypop_genomics-1.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.8 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

pypop_genomics-1.0.2-cp310-cp310-macosx_11_0_arm64.whl (1.1 MB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pypop_genomics-1.0.2-cp310-cp310-macosx_10_9_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pypop_genomics-1.0.2-cp39-cp39-win_amd64.whl (294.0 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

pypop_genomics-1.0.2-cp39-cp39-musllinux_1_1_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

pypop_genomics-1.0.2-cp39-cp39-musllinux_1_1_aarch64.whl (1.5 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ ARM64

pypop_genomics-1.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pypop_genomics-1.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.8 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

pypop_genomics-1.0.2-cp39-cp39-macosx_11_0_arm64.whl (1.1 MB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pypop_genomics-1.0.2-cp39-cp39-macosx_10_9_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pypop_genomics-1.0.2-cp38-cp38-win_amd64.whl (293.8 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

pypop_genomics-1.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pypop_genomics-1.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.8 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

pypop_genomics-1.0.2-cp38-cp38-macosx_11_0_arm64.whl (1.1 MB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pypop_genomics-1.0.2-cp38-cp38-macosx_10_9_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pypop_genomics-1.0.2-cp37-cp37m-win_amd64.whl (293.4 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

pypop_genomics-1.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.4 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

pypop_genomics-1.0.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.8 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

pypop_genomics-1.0.2-cp37-cp37m-macosx_10_9_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

pypop_genomics-1.0.2-cp36-cp36m-win_amd64.whl (310.6 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

pypop_genomics-1.0.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.4 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

pypop_genomics-1.0.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.8 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ ARM64

pypop_genomics-1.0.2-cp36-cp36m-macosx_10_9_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

Supported by

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