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.3.tar.gz (4.3 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.3-cp313-cp313-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.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

moments_popgen-1.4.3-cp313-cp313-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

moments_popgen-1.4.3-cp313-cp313-macosx_10_13_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

moments_popgen-1.4.3-cp312-cp312-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.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

moments_popgen-1.4.3-cp312-cp312-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

moments_popgen-1.4.3-cp312-cp312-macosx_10_13_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

moments_popgen-1.4.3-cp311-cp311-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.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

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

File details

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

File metadata

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

File hashes

Hashes for moments_popgen-1.4.3.tar.gz
Algorithm Hash digest
SHA256 70eb4b748bada6c6549c26b2ca7d4606002d222bffd8731df3dc49fe40c2028f
MD5 ea98ce608b50e03e9fc7da2a2f397c95
BLAKE2b-256 8c4ea8765036c03397fb0d8e1ea5ff05a5197b3be3534c4d869763c09c46bdfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.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.4.3-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.3-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d14b9cc6cf3765aafa4ca56ce319fad313c0579518719b68ecef489ce8b32a35
MD5 f6bdf4fe866c6756fdd16cf815e52c2f
BLAKE2b-256 0d6e41bf95a04addb39b18bb44e1fab98256bd5b424c171cc51264dead9f19d0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for moments_popgen-1.4.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3adac0d5bfaac9426b2095f97005ea9f5543333377d32f70cab401f2bd867a9c
MD5 5da15b6dbd54944a3d46835197dc4b1c
BLAKE2b-256 cb678fe6a8cdeed26eb732ce5e12a15b7325ac067bb81f16a953912d579b835c

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.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.4.3-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.4.3-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 3ef2ae9f894c7be0b0e1999f126b9e05f50192f6755ec9e1516929f21b72f4e5
MD5 7be93e9adbe77f650d8ec314fc09519d
BLAKE2b-256 ff8685ec9e892a9cd7db910c4f501a33dc24ba0205ec3e980024a43be00bbca7

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.3-cp313-cp313-macosx_10_13_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.3-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.3-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8590ae6bc57f97a6b625f0f3eadb4e31b6634790103b1e58e8d0322e63cdd4d0
MD5 8500e0d6b21308ed268df33eb7319096
BLAKE2b-256 26273244d7518e81845b14189fad4fb05ee7ea64acf2044331af3eb0c0a82e1c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for moments_popgen-1.4.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 baeb7bb32437bd30fbd3b698f71834d158309f7c4d985130ee5619902fbcb177
MD5 656e0eeb450c278345271c3802098026
BLAKE2b-256 9ddbab311305ad6c6e822cdac13632ff2b29e6b9ada818d833d94d93c1ed6b00

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.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.4.3-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.4.3-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 171229bd2f52bd80547f1632c794efbaae0e667cde44bb6fa9a9f0ed51e5a02b
MD5 bcba4a28a7f99ee50504d021f40adb2c
BLAKE2b-256 5882c1a9d1c025d8896a47734d0fee0e5546c86d2b4881ef976b2866033884c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.3-cp312-cp312-macosx_10_13_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.3-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.3-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9739cc3c18341761d2c678a358eb73d2be9838bf0dfc6ba48fbaa3f2d4ab3360
MD5 de69c309b67db743aff03ffe4a30a8bb
BLAKE2b-256 6955a0841b17c8cb495e1440b66137d1900c1834dbf34c8ba71a599eddaa4759

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.3-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.3-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.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 620efbd356e57c1500a836f495ccad4b53d9ed05044417ff24b510da724a989b
MD5 a80c554bac8cf38478998e3107ef6a25
BLAKE2b-256 2e3dd5ac306b439de9ac3ba4b86ac57650e7d359acd0046dcb4e15102f3d70ca

See more details on using hashes here.

Provenance

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