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.2.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.2-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.2-cp314-cp314-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

moments_popgen-1.5.2-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.2-cp313-cp313-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

moments_popgen-1.5.2-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.2-cp312-cp312-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

moments_popgen-1.5.2-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.2.tar.gz.

File metadata

  • Download URL: moments_popgen-1.5.2.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.5.2.tar.gz
Algorithm Hash digest
SHA256 d1ff9de8468692b4184784dbbe4e3b2bb158f888e92a5a57695da90e0a5e8ab6
MD5 cc4055d996c4efe4584d995e70b6125e
BLAKE2b-256 d40459f7bc638d470123b3cb95603418599d6da09fae06dbf9e4541fb69727e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.5.2.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.2-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.2-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 f5d8a581337c8fa54384e6663fbd2a1f89da054c99ca23948cc666c039ec2bd1
MD5 1f3bb890a77299e49d53668c365209ce
BLAKE2b-256 5b7dcf55e68aa00d26815dc7de48a3b66482fc1cd5e25a041695c058041b43c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.5.2-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.2-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.5.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 da23c2957a6891ebe35eef81e0af9932fd84624d8ae099416e8f90445bfdd576
MD5 3167f14fc002d6499e57f63e8840678c
BLAKE2b-256 5a22a4443e325fe1805b97d9c66c70127fc83843f8322eed810269ec82bcedd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.5.2-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.2-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.2-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 12d6680be9a6c725aa935383d389b04dd5f522f6a47cbbf66246892dd9548ad0
MD5 18ed25648cfa7a7ab4d97eea52aba229
BLAKE2b-256 53b6e521d2a52471592d8e3e10df48f4b3ac4b18f65c967597b39df6648699b2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for moments_popgen-1.5.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f47b22725069d8274bd813c933d020b653d4a97a7f6fe4dcf358cda4b5e8994f
MD5 fdd76bbe12cbdc434f9d119dfde44c7f
BLAKE2b-256 b66c8410773d01e78f5d0910fc991e91241b32534202698ed12ede5cc45d8e43

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.5.2-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.2-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.2-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 0b60255f5b25611cd64993cb1b765c35c06b47e28fbabe8e45db16fd9e97b9b0
MD5 160000e5af8f1a2733780bb86b97965e
BLAKE2b-256 89e1aac955007416fef18d1ff8044a13f824b33787d260feb85a2f72109e6be9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for moments_popgen-1.5.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 71b55b6c7cbd82549ceb9b924dd594ec4dac4ca9b0d3dbe4eda5356ddc9468cb
MD5 db819cb83b2fe62afec0d39949ff1f91
BLAKE2b-256 b2c27339fb93f903dce7fe101ecf22e39b74df86bbcb6b4ccc0f0462deb03356

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.5.2-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.2-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.2-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 446721a4cb23a5ad6bd12b6597c18140636e8737029ce9350a197f3f45d2b658
MD5 0734fd8c2b89609c470bf82a7a09c756
BLAKE2b-256 d507abb7b67554e79e26b6317adaa11b05e618eb2fb2f07536e0b739bf94d30c

See more details on using hashes here.

Provenance

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