Skip to main content

Population genetic statistics for evolutionary inference

Project description

moments: population genetic analyses and inference using diversity statistics

Please see the documentation for more details, examples, tutorials and API usage.

moments provides a suite of methods for demographic history and selection inference from genetic data, based on diffusion approximations to the one- and two-locus allele frequency spectrum. moments is modeled after the ∂a∂i open source package developed by Ryan Gutenkunst. For SFS-based methdos, we largely reuse ∂a∂i's API, but introduce a new simulation engine. This new method is based on the direct computation of the frequency spectrum without solving the diffusion system, removing the need for frequency grids as used in ∂a∂i. moments.LD, packaged within moments, implements methods for computing linkage disequilibrium statistics and running multi-population demographic inference using patterns of LD.

Getting started

moments now supports Python 3, and we no longer guarantee compatibility with Python 2.

The simplest way to install moments is using pip:

pip install moments-popgen

moments can then be imported using import moments. Important note: pip install moments installs a different package named moments, and our pypi package is named moments-popgen.

We can install the development branch directly from Github by running

pip install git+https://github.com/MomentsLD/moments.git@devel

Alternatively, you can clone the git repository to make an editable or development build.

git clone https://github.com/MomentsLD/moments.git

and then from within the moments directory (cd moments), run

pip install -r requirements.txt
pip install .

If you use conda, moments is available via bioconda:

conda config --add channels bioconda
conda install moments

Citing moments

If you use moments in your research, please cite:

  • Jouganous, J., Long, W., Ragsdale, A. P., & Gravel, S. (2017). Inferring the joint demographic history of multiple populations: beyond the diffusion approximation. Genetics, 206(3), 1549-1567.

If you use moments.LD in your research, please cite:

  • Ragsdale, A. P. & Gravel, S. (2019). Models of archaic admixture and recent history from two-locus statistics. PLoS Genetics, 15(6), e1008204.

  • Ragsdale, A. P. & Gravel, S. (2020). Unbiased estimation of linkage disequilibrium from unphased data. Mol Biol Evol, 37(3), 923-932.

If you use moments.TwoLocus in your research, please cite:

moments is developed in the Simon Gravel and Aaron Ragsdale research groups, at McGill University and UW-Madison, respectively. For any issues, questions or bug reports, please open an issue on Github.

Dependencies

If you install moments from source (e.g., after cloning the repository), you will need to install the dependencies. These are all listed in requirements.txt, and can be installed via pip after navigating to the moments directory:

pip install -r requirements.txt

A few more details: moments and moments.LD requires a handful of dependencies. At a minimum, these include

  • numpy

  • scipy

  • cython

  • mpmath

  • demes

We also strongly recommend installing ipython.

If you are using conda, all dependencies can be installed by navigating to the moments directory and then running

conda install --file requirements.txt

Once dependencies are installed, to install moments, run the following command in the moments directory:

python -m pip install -e .

You should then be able to import moments in your python scripts. Entering an ipython or python session, try to import moments. More details on installation can be found in the documentation. If, for any reason, you have trouble installing moments after following these steps, please submit an issue.

If you use Parsing from moments.LD, which reads VCF files and computes LD statistics to compare to predictions from moments.LD, you will need to additionally install

  • hdf5

  • scikit-allel

  • pandas

Changelog

All changes are detailed in the documentation.

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

moments_popgen-1.3.1.tar.gz (4.2 MB view details)

Uploaded Source

Built Distributions

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

moments_popgen-1.3.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

moments_popgen-1.3.1-cp312-cp312-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

moments_popgen-1.3.1-cp312-cp312-macosx_10_9_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

moments_popgen-1.3.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

moments_popgen-1.3.1-cp311-cp311-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

moments_popgen-1.3.1-cp311-cp311-macosx_10_9_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

moments_popgen-1.3.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

moments_popgen-1.3.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

moments_popgen-1.3.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

File details

Details for the file moments_popgen-1.3.1.tar.gz.

File metadata

  • Download URL: moments_popgen-1.3.1.tar.gz
  • Upload date:
  • Size: 4.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for moments_popgen-1.3.1.tar.gz
Algorithm Hash digest
SHA256 0a3090462379a09bb16af494d8887258c9ad0e62698365fb84d80a6ab9eec638
MD5 bf7c1da35a3a17d78d99186c3e1f9421
BLAKE2b-256 f2b9baea53ace1f17b7ed31e4410c4becb07408be63f74e58400d08c01791ea5

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.3.1.tar.gz:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moments_popgen-1.3.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.3.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 89cbcda9be58d707e3aab6032700b68aaf3e378b8350481d48134a6b32877084
MD5 224f584f7cedce026967168d75708ff8
BLAKE2b-256 813a44a622b776810ee7ae34fe26cc8a2579715a3a350f31594715e46ef4fb05

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.3.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moments_popgen-1.3.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.3.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4ff56e8122a38df4fd858003c8f561b0342c283516f7481224497c668b99fc25
MD5 b6bbe694dba841290f2a27785b319713
BLAKE2b-256 5a869c1eed5ce2358f654d0c09d170cd866974d86c69c7ee42eed999e01574d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.3.1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moments_popgen-1.3.1-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.3.1-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c2baa9d1c9150136ba2e00063a21e6f8ce29a9fdb1de7ef2b2f0cae0d87d89ea
MD5 f01044be39ed0df1107d0d56a601273f
BLAKE2b-256 457dc6caaf9dc1072e6650c70ad8c4a2aecc0a6dfa0c938e7e7b464f513c6388

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.3.1-cp312-cp312-macosx_10_9_x86_64.whl:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moments_popgen-1.3.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.3.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3e90042fc70460b52ee6ee4f94ead889de8d3294d40626926e7b2a631d752e07
MD5 d3dc9f0a81a8429c5f3cd1666e399774
BLAKE2b-256 836c132fcfd64d263d1c35f05aba4df37132de797ae1c3868967a7e3f557bedc

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.3.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moments_popgen-1.3.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.3.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a128e63caede6b2093f2e6de06811c08173ba4c5fffbf39e3d424db27e834542
MD5 42bbde0317a3e5e17dbe2e557a9e4fc1
BLAKE2b-256 ba000d5dbc43b2cd4c7e6b2fa376871f70ec62d024f262ced2a6529efe474026

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.3.1-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moments_popgen-1.3.1-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.3.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 edbd80bb3b0b87b45e862e45213fa9bd0a12aa937cb3a3a1d17b68c519ee0afd
MD5 be9db0d2378bc86662315731f6bcc5dd
BLAKE2b-256 9f5550375fa66f37739dca4dbf056b19b37ba338eb268a987b5b5ea033cff451

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.3.1-cp311-cp311-macosx_10_9_x86_64.whl:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moments_popgen-1.3.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.3.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 95820102b14ea8091ea1d5b426c4c69d5399b7ab4987e5342203205db9f1480e
MD5 bbc6bc9d3161625fcc90a00c3ea4353f
BLAKE2b-256 6c805698e6941df1a4b6c6413ffca115d90b99e92ebc3eb5c8824e2ae4f60b60

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.3.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moments_popgen-1.3.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.3.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0ae2044bf5063ec2ff65c30ea85df86a5f6b0b8e3bf727538c0c2722df212e00
MD5 b0ca774c98cdbd1f07c58e0582860c04
BLAKE2b-256 d517466e112bb5ef08f28924e8f7b3a4be834fc436a0f299f5e979100ea8dc80

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.3.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moments_popgen-1.3.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.3.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e4b30b0dccdf7086125e5fbd0d9f5f63a9c61eac234c28ee507ae68fb1917ee1
MD5 c47874bf6275b80499a1cbc0ca938bf2
BLAKE2b-256 7ac4312a77ee5d40e78de52d0db0308c6e84a4092db6c91bbe51154730fc757e

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.3.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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