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.5.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.5-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.5-cp313-cp313-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

moments_popgen-1.4.5-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.5-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.5-cp312-cp312-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

moments_popgen-1.4.5-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.5-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.5-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.5.tar.gz.

File metadata

  • Download URL: moments_popgen-1.4.5.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.5.tar.gz
Algorithm Hash digest
SHA256 324820fe5e78655cfdc052fbf7176340c211ef6562db5411fab2f1b1702706c7
MD5 d440fa12b8c22f69f8a2b258464307cf
BLAKE2b-256 9c9aa7dc44a9dd52cd1f455a007442fb8e20bb095235c7184bd34bde9971ece5

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.5.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.5-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.5-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cf59050f11cb6cc2fe81ecdb2879246a42a168e5df1e41e8c10bee674176326d
MD5 c8dd5ae0b908b15434776d20a4211f78
BLAKE2b-256 42b35182289373ef9c32bf133439aa7fd14ce049af8bdd9164ea3616ad1a4475

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for moments_popgen-1.4.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5af82e51b17c282f613f33db622e019c587f6a970866d6229c86be9ed7d6e4fa
MD5 51c82d52d5852638ec8ee3c9cdc9f4c4
BLAKE2b-256 6bf17bdb593a0c9a3683ec56db18ff6363752c4b8f03842c372042e9a6b577ba

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for moments_popgen-1.4.5-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 bda4a74f092f1567514b0c78ea28b46047e85629b817ea332cf41e5a696449c1
MD5 70329fd68605befbe32861c47d1757ac
BLAKE2b-256 6766ead128de56e1425060cf77668b7edbe787bec33a72ece85c4f1b69fef891

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.5-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.5-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.5-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4a84c62bf8aa5494ecf269385b0b9188b5025201b8f764d8cdf2d279a6eb12c4
MD5 399691593ff78f97a65c9ed0c4086ed5
BLAKE2b-256 fe97d33d6d243cdc1014d74341a9ce9c4f72c24a719f1db0751dda59551a6b42

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for moments_popgen-1.4.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 807fb44d12ddc3889140646b862298530820e9f99b07ae4b0fbf36e8ae053d52
MD5 9ca9ef0a11449279dab8f822fdf95c54
BLAKE2b-256 44db11d54c3b14a46b9faa9facba9ec632e94dfac77fef9649ac4d1196ac322f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for moments_popgen-1.4.5-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 bc4f2c6c6253f345daed20099367a4ccf0e20642d2dcfe522ca05e8c481156ef
MD5 ec737f32b81c20c1bebbc225206f80e5
BLAKE2b-256 9a91ca6527aaddaf049e02ae4ff39131d0d93e57fc72bca1a037c2f7c46cf870

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.5-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.5-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.5-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a904d8f3d5ff212ab2f15b8711debfefc496bb05e6ed1f363284ae7c1a538826
MD5 b4bef31aab8545da3b01eb02a084f853
BLAKE2b-256 5d6d9f4395dd3e1692bd2b49fb0ab6366c01134b7e53184582444eb53a8b4ca1

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.5-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.5-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.5-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 80e6d277df90413e3721241d3192d597d9e77c3098c30e6053b88a96f98d18c0
MD5 849cdd87a05756242aaff53bbe2403f6
BLAKE2b-256 3f0a24e69abe9ea8b786ff3de9b7cb95f5c30959e9b20d14ab7e43976228f957

See more details on using hashes here.

Provenance

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