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

Uploaded CPython 3.14macOS 11.0+ ARM64

moments_popgen-1.5.4-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (4.6 MB view details)

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

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

moments_popgen-1.5.4-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.4.tar.gz.

File metadata

  • Download URL: moments_popgen-1.5.4.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.4.tar.gz
Algorithm Hash digest
SHA256 2508b478d7c517ef5c8d42ce6799e93fe0b2d78b85013ad97d28cf542742ea5b
MD5 ceeab02393dd96c055485bfa41c9abb1
BLAKE2b-256 c02232f148303731cbf667ba3e7d8773a9a499c57a312b8d32d0fe8c5282bc3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.5.4.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.4-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.4-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 8e3f67e83249e56770d9c36c7b5693f69f01a209f8577cf2ed3b90a1c217ab34
MD5 e18f184a6d6f7d8020cd7d37beb7df42
BLAKE2b-256 00f989c0d99f8caf4b2907889156d63fc6cc61ddb11458ff3314a0fa9384df23

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for moments_popgen-1.5.4-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4825c9564d6e2c9364a129818af2286262cf56540b9df1d9cc3c4799f34e1780
MD5 535a0ae3c616f80885c09658bbadf18c
BLAKE2b-256 f86a1155a7f649bf20d29f6ae7407ec48ee75fad160a5e5f28e2d3749bc18825

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.5.4-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.4-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.4-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 ac0879afeb7860f2e6dde0d5975faa2ea1f64239dffb2b2e5ff7f3b523194b98
MD5 005b11ec5d9d5fa7f86947f3443649d6
BLAKE2b-256 85d5b1844a05797da9c10ac87bc501ad23a428f43787fadc5221f8a841b736c1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for moments_popgen-1.5.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 98e09368fe93a60e8f6994218347fe4656a5b1c7f67aa7fb1fe2ace78d96116b
MD5 05fb08d718a862ffac7d424b1af0ae62
BLAKE2b-256 82a37202c6723761ccf09cbeeb3a848d8fef3807b8b218b0d67eb3a9840ce35f

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.5.4-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.4-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.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 990a9d55430369c9f35e5d292b1f5731c04984dbc2a4a17b2850b054badead9d
MD5 432605be4c6dabcbb34e4d4c5961929f
BLAKE2b-256 2644eb9aadde1372dec4d8a8fef9fc467851ee7fff69cb2a2494bfff24dff9ff

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for moments_popgen-1.5.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 56a6f1bf03451db63c9627e28f7b2a245d12694f6f9ee2bf27923110f3d33fc8
MD5 77f40117e5adcd34d8903a764e5dbeea
BLAKE2b-256 1cf2a360e7ac915c1ebae2cb8b0fe654f2c620a4bbaeae719fed06b197186837

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.5.4-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.4-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.4-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 25bc4bf046e1f5962c92ef9b9771bd46c90a870d770e0f1d4e0e324070bb590d
MD5 20856b189a72821a489c8bdbf402e1e8
BLAKE2b-256 ece248fa767ffc95b706e9705b584cb2ec58c5d979a0c9f598dbfef107887369

See more details on using hashes here.

Provenance

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