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.5.3.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.5.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

moments_popgen-1.5.3-cp314-cp314-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

moments_popgen-1.5.3-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (4.7 MB view details)

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

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

Uploaded CPython 3.13macOS 11.0+ ARM64

moments_popgen-1.5.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (4.7 MB view details)

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

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

Uploaded CPython 3.12macOS 11.0+ ARM64

moments_popgen-1.5.3-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (4.5 MB view details)

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

File details

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

File metadata

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

File hashes

Hashes for moments_popgen-1.5.3.tar.gz
Algorithm Hash digest
SHA256 1c1c0de283bfc85ebca9858fd391676731e9560f5d8c731b79672f7e4b7ae221
MD5 062a348a1655c75441c05c5746b6fb26
BLAKE2b-256 b86d366d3d5929123201102899ac75abdea294843fd6196ed510ea195f4e88ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.5.3.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.5.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.5.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 f4cb899e73b19436f378f03fe97e4c80d908e5fe94e828f6b5c5536a506730de
MD5 7f2386bb25065564e21f4e77fa58e3f4
BLAKE2b-256 071dccf4496e912fe6bdcc8a62b78b0d87dd52763ea7e06d9af93d220317ca4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.5.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_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.5.3-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.5.3-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ae4fbba614ad71082b8b3d2195ef6a9cb52a7cced5e9776c3e3c10a9c599d995
MD5 672cd0cb1b70397c0cb548f61c832634
BLAKE2b-256 db1c5fa1e9b18975633d63a6466515d898b2b391c763f62ebbbead03d21df5e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.5.3-cp314-cp314-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.5.3-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.5.3-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 f32f219bbc9ceb9ce779a350104c6e2dc3eb034aa3c3ec553ed48716940adae8
MD5 7fa37dac175a664dab6c265d21aa94c1
BLAKE2b-256 6b135935adeecf0a181fd0d66d2cadbf34c2032345a6c7951e6685959107ed10

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.5.3-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_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.5.3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.5.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a62eda10ef2f1491999f20aa9ed2a3110550c6798d6179fd503a020ccc0e077f
MD5 ac16562f12cc19bea8bdda991529b07d
BLAKE2b-256 dcda6d02a57c39c97d60d40a66d3aaec306a84cbb1f56a954073d8708729e752

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.5.3-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.5.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.5.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 04c6377939d03d2978eb045397e3a47c5552e11e2652a50a2ad20eb09203d684
MD5 df5fcd158cce47d3d33063bf16499038
BLAKE2b-256 d9c101503222f745f52aae7dbf6d3e0ae365e4371fda43047d507fa7b865644d

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.5.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_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.5.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.5.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e8765a323e6842804ffdc5ab62ddfc3bc6e186d18841fdae1ddcedfd6b1391d8
MD5 0567842780fe2d6f37a6570a130dde22
BLAKE2b-256 050e31c44acda3a0d57d399d10eb512cb860216c8c00dd340882de8d869df144

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.5.3-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.5.3-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.5.3-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 b824d99d5bafc92525f58d8ae5bfbcecd4c93dff0d7a48b30688dfd9576aba6b
MD5 dc0797862145f2663a9e86eca6e97c05
BLAKE2b-256 712b3d820cd4000107d0db7224fae03b6db8ff2c64f101a66ae1c3d64b06c79c

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.5.3-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_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