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.4.6.tar.gz (4.4 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.4.6-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB view details)

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

moments_popgen-1.4.6-cp313-cp313-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

moments_popgen-1.4.6-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB view details)

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

moments_popgen-1.4.6-cp312-cp312-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

moments_popgen-1.4.6-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.4 MB view details)

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

moments_popgen-1.4.6-cp310-cp310-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.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

File details

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

File metadata

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

File hashes

Hashes for moments_popgen-1.4.6.tar.gz
Algorithm Hash digest
SHA256 2a83f549d5eba33ec38034ca088d1ca569084c09b32c2997b11a4edb5c166825
MD5 c3c899888007a8c1e8ae7cdea86f9239
BLAKE2b-256 647d81c92cfd386af7b45d83d690fa3f11eaf654913b1ac91828209bc14a0249

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.6.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.4.6-cp313-cp313-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.4.6-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dd85be0c344b20ba29a88d040864462ffb781945774fbf7fad72376337407ec8
MD5 5806c63fb7efc9c279e425f2d59a9cd4
BLAKE2b-256 15aa716b1152ea0b606b464f79f59a9ba1f32672a3c791919a4d05dfb2c7713d

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.6-cp313-cp313-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.4.6-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.4.6-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c067b0de2fda9520446c99dc97c630cf6ae12d40d79df61a8731755fe5d66fb8
MD5 68b0fe750c7bc1dd6ee817e877d024d8
BLAKE2b-256 fc8f29913cd64e026601b65f0fb9c144c2827cb4cedcedcbc852b8fcd18404e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.6-cp313-cp313-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.4.6-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.4.6-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d12ad7ea7bf3311119ee40f0c7ac40e50a9f953bcd82ab7f302902f2aae4af29
MD5 f084ca7e8bc71a4b53033d4640d643b5
BLAKE2b-256 53f93c639394197ccf7ac6a89ee55063cec81ac064f1968349136c6ddfac4e6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.6-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.4.6-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.4.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 414a42b9bc2dd8f629a7630ab128b59fa185bf0712fa63ffe3517fb2a9301742
MD5 cbd556459eccdec8de60ffa3f7393041
BLAKE2b-256 712798df19a2b8beb367df1d4c747eea333b4060fae03062481142c0fa50cb7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.6-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.4.6-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.4.6-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b3b1ec390918f3219c9a8eaa1e59130a8a7217ddf1d0c2e3f997e2933c924b2e
MD5 f90d21cb2399462ba556fcc7b97d8426
BLAKE2b-256 e45553311d70afd1b549ab2c829481cd47976fadb29d3193b3a2d652c965837e

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.6-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.4.6-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.4.6-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 046070a21d0c7a084392bd71f946aa5153c23ace7f7535927b9470f750852bec
MD5 6734cbbc832e1a42b13b6d22a1530e2f
BLAKE2b-256 2e12cac4bc3dbd80486948d8a9e91f48082e63abbcf7c947793e9c9665630ab4

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.6-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.

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